network出错

1、更改IP之后,执行service network restart时出现 shutting down interface eth0:Device state :3(disconnected)的问题时,执行service networkmanager stop (关闭networkmanager服务)、

chkconfig networkmanager stop(下次不自己启动)

2、 ip地址只能单方面本机到虚拟机的ping通,则关闭虚拟机的防火墙,如果双方都不能ping通,检查是否host-only模式 

3、执行service network restart 时最后一项出错,检查ifcfg-eth0中的MAC地址和virtual box中显示的是否一致;看/etc/udev/rules.d/70-persistent-net.rules中 etho和eth1的问题

4、ifdown eth0

错误提示信息如下:

Shutting down interface eth0:  Error: Device 'eth0' (/org/freedesktop/NetworkManager/Devices/0) disconnecting failed: This device is not active

需执行chkconfig NetworkManager off 关闭其服务

5、配置

[root@upright91 network-scripts]# more ifcfg-eth1 
DEVICE=eth1
TYPE=Ethernet
UUID=eaf98ad9-5f58-4cfd-bbc4-c212637815ee
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.0.91
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
NAME="System eth1"
HWADDR=6C:92:BF:2B:6B:F3
LAST_CONNECT=1469177995
 
如果你要自动获取IP地址。就将BOOTPROTO=static
改成BOOTPROTO=dhcp
 
 
[root@upright91 network-scripts]# more ifcfg-eth0
 
 
DEVICE=eth0
 
ONBOOT=yes
BOOTPROTO=none
 
IPADDR=10.10.10.91
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=202.106.0.20
 
TYPE=Ethernet
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
HWADDR=6C:92:BF:2B:6B:F2
LAST_CONNECT=1469177995
 
 

 

posted @ 2015-12-21 17:52  qian@@jing  阅读(427)  评论(0编辑  收藏  举报