安装CENT OS时手动配置了IP和DNS,安装完成后,IP未生效
[root@localhost network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
BROADCAST=10.205.1.255
GATEWAY=10.205.0.254
IPADDR=10.205.0.70
NETMASK=255.255.255.0
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="cbf78fc4-dca7-431f-bacb-66e9fb152dcd"
HWADDR=5A:2D:8A:5F:F7:9C
PREFIX=23
DNS1=211.155.27.88
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
LAST_CONNECT=1417162738
重启网络服务service network restart:
有如下报错
hutting down interface eth0: Error: Device 'eth0' (/org/freedesktop/NetworkManager/Devices/0) disconnecting failed: This device is not active [FAILED]
Shutting down interface eth1: Error: Device 'eth1' (/org/freedesktop/NetworkManager/Devices/1) disconnecting failed: This device is not active [FAILED]
搜索网上解决方案:
- chkconfig NetworkManager off
- chkconfig network on
- service NetworkManager stop
- Stopping NetworkManager daemon: [ OK ]
- service network start
Bringing up interface eth0: Device eth0 has different MAC address than expected, ignoring
再搜解决方案:
#ifconfig eth0 down
#cd /etc/sysconfig/network-scripts
#vi ifcfg-eth0
修改其中的"HWADDR=xx:xx:xx:xx:xx:xx"为"MACADDR=xx:xx:xx:xx:xx:xx"
#ifconfig eth0 up
#service network start
问题解决,日志如下:
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: RTNETLINK answers: Device or resource busy
[ OK ]
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
[root@localhost network-scripts]# ifconfig
eth0 Link encap:Ethernet HWaddr B6:D7:97:82:7A:26
inet addr:10.205.0.70 Bcast:10.205.1.255 Mask:255.255.254.0