1. Virtual Machine Network Mode select NAT mode to ensure the local Host network connection is OK
2. View the local virtual machine segment: VMware Click Edit--Virtual network edit->DHCP settings to see their starting IP address as 192.168.252.128
3. Configure /etc/sysconfig/network-scripts/ifcfg-eno16777736
VI /etc/sysconfig/network-scripts/ifcfg-eno16777736
Type=ethernet
bootproto=static #dhcp为动态获取IP改为静态static
Defroute=yes
ipv4_failure_fatal= No
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_failure_fatal=no
name=eno16777736
Uuid=e0e76cb3-37ad-4814-b554-4b6904a27a86
device=eno16777736
Onboot=yes #启用自动网络连接
Peerdns=yes
Peerroutes=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
ipaddr0=192.168.252.128 #设置本地虚拟机IP
prefix0=24 #设置子网掩码
gateway0=192.168.252.2 ; #设置网关
dns1=114.114.114.114 #设置DNS 8.8.8.8 is a Google DNS server that sometimes doesn't work well at home
DNS2 =8.8.4.4 #设置备用DNS 8.8.4.4
HWA ddr=00:0c:29:a9:49:5f #本地虚拟机虚拟mac地址
4.service Network Restart Restart the Web service, ifconfig command to see if the IP address you just configured
Verification: Ping www.baidu.com--can ping Baidu IP and cannot ping the same domain name is generally a DNS problem, set to 114.114.114.114.
VMware installation Redhat Configuring a static IP connection network