1. Set the virtual Machine network card VMnet8
As shown in the figure, I set the IP to 192.168.80.1, and save after setting. 2. Modify Virtual machine Parameters (1). Click the edit--> virtual network Editor, set the following figure
(2) The NAT settings are as follows
The main gateway IP set correctly, because I outside the IP set 192.168.80.1, this gateway for the outside IP network segment of any IP can, here set to 192.168.80.2, this is very important, because in the CentOS to set the relevant information. (3) DHCP settings
General point in the system is set up by default, this side should note that the DHCP mode of the random IP is in 192.168.80.128~192.168.80.254 such a range, and static IP range is 192.168.80.1~ 192.168.80.127 (cannot be duplicated with external IP and a gateway set by itself).
When the setting is complete, start CentOS and go in and set the parameter 3. Modify the CentOS parameter (1). vi/etc/sysconfig/network-scripts/ifcfg-eno16777736
Bootproto to be static, that is, statically IP mode
ipaddr is the IP address, select 192.168.80.1 to 192.168.80.127, note that you cannot repeat with the outside IP or gateway
netmask Subnet mask, for 255.255.255.0
Gateway for Gateways, 192.168.80.2, previously set
DNS1 with Virtual network Guan Lai as, also for 192.168.80.2 (2) Restart network
Systemctl Restart Network Restart service
Verify that you can access the Internet
View your IP now
IP addr
That's it.