Because of the need to have a virtual machine configured, and found that the previous method has a problem, you need to configure DNS resolution to recognize the external IP domain name.
# 查看是否有DNS配置cat /etc/resolv.conf# 添加DNS配置vim /etc/resolv.conf# 填入DNS服务器nameserver 8.8.8.8nameserver 8.8.4.4
Prior installation of CentOS7 requires the use of a domestic yum source to install some applications, but in the use of NAT mode, it is found unable to connect to the extranet:
Ping www.baidu.com
Baidu Ping does not pass, but the host IP can ping through.
In the degree Niang looking for some, according to some methods to try to have no effect, such as the addition of DNS resolution.
Finally, we found the network reconfiguration in NAT mode, but there are still some points that need special attention.
1. Open the Virtual network editor
Edit >> Virtual Network Editor
2. Restore the default configuration
Here because of my win10 when the Home Edition is not able to directly restore the default configuration, need to get permission to change settings, directly click Change Settings.
Then just wait for a while and then restore the default settings
3. View NAT and DHCP information
After restoring the default configuration, select Nat mode and then click NAT Settings:
You can view the subnet IP, mask, and gateway
Click OK, go back to the previous step in click DHCP settings
Note here to see the starting IP address and end IP address, as in this article:
192.168.106.128 192.168.106.254
After that we need to set up a static IP in Linux, the selected IP address in the above range is selected, in addition to the broadcast address, but generally this is not important.
4, modify the IP address of the CENTOS7
Cd/etc/sysconfig/network-scripts
Vim ifcfg-eno16777736 This may not be the same for everyone, but the style does not change
Modified to:
Type=ethernet
Bootproto=static Modify to static IP
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
Ipv6_failure_fatal=no
name=eno16777736
uuid=5611b701-d309-4eca-85ce-49a850f62592
device=eno16777736
Onboot=yes boot up
ipaddr=192.168.106.201 IP Address
netmask=255.255.255.0 Mask
gateway=192.168.106.2 Gateway
The choice of IP address must be in the third step of the IP range of the query, or still not connected to the network.
Now restart the Network service:
Systemctl Restart Network.service
5. Test the network connection
WIN10 View host IP (VMNET8):
Win + R
Enter PowerShell, and then enter
Enter ipconfig in the open window to view the IP address of the VMNET8:
CENTOS7 Testing Network Connections
Ping 192.168.106.1
Ping www.baidu.com
The output is normal as follows:
Workaround for CentOS7 in VMware cannot connect to the extranet in NAT mode