在系统启动的时候eth0一直无法启动,设置了地址之后也一直无法启动、排错过程和大家分享下!
1、在执行虚拟机启动或者service restart的时候,总是会出现这样的提示:
Bringing up interface eth0: Active connection state: actived
在网上搜索了部分信息,发现这个问题是由于【出现这个情况的可能原因是同时启用 NetworkManager 和 network 服务】
可是我 在查看我的服务的时候竟然没有发现有一个服务是networkManager
详情如下所示:
[root@localhost Desktop]# chkconfig --list|grep net
netconsole 0:off1:off 2:off3:off 4:off5:off 6:off
netfs 0:off1:off 2:off3:on 4:on5:on 6:off
network 0:off1:off 2:on3:on 4:on5:on 6:off
因此我觉得很奇怪,于是又重新看了下我配置的eth0文件,发现如下的问题
2、我发现是我eth0的设置里面设置了BOOTPROTO="dhcp",于是我将这个bootproto给注释掉,之后显示的eth0的链接就是通的了。
[root@localhost network-scripts]# 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/3
state: activated
Connection activated
[ OK ]
[root@localhost network-scripts]#
3、但是现在ping 192.168.1.1还是ping不通,然后我就在想nat要实现的功能,想到了我的网关不能是我想设置成什么就设置成什么的,要设置的同vm虚拟机的一致
于是我打开下图的虚拟网络编辑器
这里我们就得到了网关地址,可以好好的设置一下了。将eth0的网关地址设置成192.168.234.1了之后,发现ping 网关地址确实可以ping通了。即存在如下的情况:
[root@localhost ~]# ping 192.168.234.1 --------虚拟机的局域网的网关地址
PING 192.168.234.1 (192.168.234.1) 56(84) bytes of data.
64 bytes from 192.168.234.1: icmp_seq=1 ttl=128 time=3.80 ms
64 bytes from 192.168.234.1: icmp_seq=2 ttl=128 time=0.157 ms
^C
--- 192.168.234.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1790ms
rtt min/avg/max/mdev = 0.157/1.983/3.809/1.826 ms
[root@localhost ~]# ping www.baidu.com----------百度网络。ping不通就不能上网
ping: unknown host www.baidu.com
[root@localhost ~]# ping 192.168.1.1---------------物理电脑-局域网的网关地址--
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=6.21 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=128 time=1.37 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=128 time=1.25 ms
PING 192.168.234.1 (192.168.234.1) 56(84) bytes of data.
64 bytes from 192.168.234.1: icmp_seq=1 ttl=128 time=3.80 ms
64 bytes from 192.168.234.1: icmp_seq=2 ttl=128 time=0.157 ms
^C
--- 192.168.234.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1790ms
rtt min/avg/max/mdev = 0.157/1.983/3.809/1.826 ms
[root@localhost ~]# ping www.baidu.com----------百度网络。ping不通就不能上网
ping: unknown host www.baidu.com
[root@localhost ~]# ping 192.168.1.1---------------物理电脑-局域网的网关地址--
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=128 time=6.21 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=128 time=1.37 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=128 time=1.25 ms
今天到此为止吧,明天看下能不能弄好!
added when 2013-11-10:今天重装了下vmvare软件和centOS,结果发现可以用了。ping 网关以及百度都没有问题。当然今天在重装虚拟机的时候直接选的桥接。。。