- 保证VMware Network Adapter VMnet1是启用状态
- 将可以连接外网的连接共享属性设置成如下图所示
- 将VMware Network Adapter VMnet1的IP地址设置成与本机IP不同的网段即可
- VMware虚拟网络编辑器VMnet1设置成如下图所示,与VMware Network Adapter VMnet1保持一致
- 通过文件配置如下
TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no #BOOTPROTO=dhcp DEFROUTE=yes BOOTPROTO=static ZONE=public 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=1a35b857-e6fc-4d09-b8ab-ed7f3a9910c0 DEVICE=ens33 ONBOOT=yes IPV6_PRIVACY=no IPADDR=192.168.25.20 NETMASK=255.255.255.0 GATEWAY=192.168.25.1 DNS1=192.168.25.1
- 重启网络服务service network restart,不行就重启虚拟机reboot
- ping测试
[root@localhost ~]# ping baidu.com PING baidu.com (39.156.69.79) 56(84) bytes of data. 64 bytes from 39.156.69.79 (39.156.69.79): icmp_seq=1 ttl=50 time=29.6 ms 64 bytes from 39.156.69.79 (39.156.69.79): icmp_seq=2 ttl=50 time=30.4 ms 64 bytes from 39.156.69.79 (39.156.69.79): icmp_seq=3 ttl=50 time=29.8 ms ^C --- baidu.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 29.698/29.986/30.452/0.332 ms
vmware中centos仅主机模式网络配置
最新推荐文章于 2024-06-27 17:40:59 发布