first step: In VMware, click "Edit" - "Virtual Network Editor". As shown in the figure below, I chose NAT mode: The following VMnet2 is configured You can write any subnet IP and calculate the subnet mask yourself. If you are not familiar with it, just configure it the same as mine. Class A default subnet mask: 255.0.0.0 To use a static IP, uncheck Use local DHCP service to assign IP addresses to virtual machines (this is selected by default). Click NAT Settings Remember the gateway IP as shown below, and finally configure the virtual machine IP file application Step 2: Enter the virtual machine Log in to centos8 with root privileges and edit the file vi /etc/sysconfig/network-scripts/ifcfg-ens33. The effect is as follows: TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static #Note that it is set to static static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=aa18fb34-fea8-4fff-83a4-1ebed631beff DEVICE=ens33 ONBOOT=yes #If it is no, change it to yes, indicating that the network card device automatically starts GATEWAY=192.168.0.2 #The gateway address here is the gateway address obtained in the previous step IPADDR=192.168.0.150 #Write anything within the gateway range NETMASK=255.255.255.0 #Subnet mask DNS1=8.8.8.8 #DNS1 here uses Google, DNS2=223.6.6.6 #DNS2 uses Alibaba Then: wq save and exit Step 3: Refresh the network card configuration CentOS 8 use: nmcli c reload CentOS7 uses /etc/init.d/network restart Summarize The above is what I introduced to you about setting up a static IP network card for the CentOS 8 VMware virtual machine to access the Internet. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Vue implements carousel animation
>>: How to view and modify the time zone in MySQL
Table of contents Introduction to frm files and i...
Table of contents 1. DOM Diff 2. Add key attribut...
Create a simple Spring boot web project Use the i...
1. First install node, express, express-generator...
Through the study and application of Node, we kno...
When using docker images, images with both REPOSI...
1. Phenomenon In the early morning, an index was ...
Q: Whether using Outlook or IE, when you right-cl...
Table of contents Add traffic function to github+...
Suggestion: Handwriting code as much as possible c...
Enable remote access Enable remote access rights ...
In front-end projects, attachment uploading is a ...
This article introduces Nginx from compilation an...
The Raspberry Pi model is 4b, 1G RAM. The system ...
NAT In this way, the virtual machine's networ...