The problem that the VMWare Fusion installs CentOS7 virtual machine cannot access the Internet in Mac

When the CentOS7 virtual machine is installed in the VMWare Fusion in the Mac, the Internet cannot be accessed, and the following settings need to be done

View /Library/Preferences/VMware Fusion/vmnet8nat.conf in the directory

Find the following:
Insert picture description hereThe gateway address of the NAT is the IP.

Edit on CentOS7/etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=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=e7bd7d3f-60f7-4bc3-a645-248680d99c76
DEVICE=ens33
ONBOOT=yes
IPADDR=172.16.17.10
NETMASK=255.255.255.0
DNS1=172.16.17.2
GATEWAY=172.16.17.2

IPADDR: The IP address of the virtual machine (IPADDR is best to be NAT gateway addressin the same network segment as the IP in. Because the host machine is also in the local area network, it is possible that the IP in a local area network conflicts with the IP of the virtual machine, and it will not be able to connect to the virtual machine)
NETMASK: The subnet mask of the IP of
DNS1this virtual machine: The domain name server of this virtual machine is set to the NAT gateway addressseen IP (that is, when the domain name is resolved, it is handed over to the host machine, and the host machine uses its domain name resolution server to resolve it)
GATEWAY: this virtual machine The gateway of the machine is also set to the NAT gateway addressseen IP

Restart the network service or restart the host

systemctl restart network

# 查看IP
ip addr

Insert picture description here
Ping
Insert picture description here
now the virtual machine can be connected to the Internet

Guess you like

Origin blog.csdn.net/qq_27198345/article/details/115366291