VMware虚拟机设置固定IP后不能上网的解决办法

VMware虚拟机设置固定IP后,不能上网

[root@localhost 20160520]# wget http://www.linux-vs.org/software/kernel-2.6/ipvsadm-1.26.tar.gz
--2016-05-20 06:10:37--  http://www.linux-vs.org/software/kernel-2.6/ipvsadm-1.26.tar.gz
Resolving www.linux-vs.org... failed: Name or service not known.
wget: unable to resolve host address “www.linux-vs.org”

查看网络设置

[root@localhost 20160520]# system-config-network
VMware虚拟机设置固定IP后不能上网的解决办法_第1张图片

虚拟机网卡使用的是NAT连接模式
VMware虚拟机设置固定IP后不能上网的解决办法_第2张图片

解决办法:
开启虚拟机的DHCP,并重启网络

VMware虚拟机设置固定IP后不能上网的解决办法_第3张图片

[root@localhost 20160520]# service network restart
Shutting down interface eth0:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/8
state: activated
Connection activated
                                                           [  OK  ]
Bringing up interface eth1:  Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/9
state: activated
Connection activated
                                                           [  OK  ]

虚拟机的网络恢复正常

[root@localhost 20160520]# wget http://www.linux-vs.org/software/kernel-2.6/ipvsadm-1.26.tar.gz
--2016-05-20 06:23:39--  http://www.linux-vs.org/software/kernel-2.6/ipvsadm-1.26.tar.gz
Resolving www.linux-vs.org... 69.56.251.119, 2001:470:1f0f:297::2
Connecting to www.linux-vs.org|69.56.251.119|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 41700 (41K) [application/x-gzip]
Saving to: “ipvsadm-1.26.tar.gz”

100%[===================================================================================================================>] 41,700       105K/s   in 0.4s 

2016-05-20 06:23:45 (105 KB/s) - “ipvsadm-1.26.tar.gz” saved [41700/41700]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26506993/viewspace-2103997/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26506993/viewspace-2103997/

你可能感兴趣的:(VMware虚拟机设置固定IP后不能上网的解决办法)