The virtual machine network configuration is NAT mode and shares ip with the host
View the host virtual network
(Recommended tutorial: centos usage tutorial)
Note that you need to check VMware8 here because VMware8 here is in net mode.
Ip address: 192.168.106.1
Subnet mask: 255.255.255.0
Then you need to configure centos with an IP network segment of 106 and a gateway of 192.168.106.2-245, please note that it cannot be 192.168.106.1, because this is used by the virtual network of the host.
Open the system configuration folder:
cd etc
vi sysconfig/network-scripts/ifcfg-eth0
Edit etho configuration file
Bootproto=static is static ip
Ipaddr=192.168.106.17 ip address
Netmask=255.255.255.0 Subnet mask
Gatway=192.168.106.2 Gateway
Dns=8.8.8.8
Tips: 114.114.114.114 and 8.8.8.8 are globally open Dns service addresses, which can also be used on your own computer.
Save the file and exit.
Recommended related video tutorials: linux video tutorial
The above is the detailed content of How to access the Internet in centos system under virtual machine environment. For more information, please follow other related articles on the PHP Chinese website!