在centos或者rehat里,设置网卡后,重启的时候出现如下报错:

Determining if ip address xxx.xxx.xxx.xxx is already in use for device eth0...

下面看看我的配置方法以及,错误解决:

1、配置网卡

[root@Server ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:6F:D7:6E
TYPE=Ethernet
UUID=14e3be88-e1a9-4ebd-bea3-6d337b161e10
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.170.136
NETMASK=255.255.255.0
GATEWAY=192.168.170.2
DNS1=192.168.170.2

2、重启网卡让它生效

[root@Server ~]# service network restart
正在关闭接口 eth0:                                        [确定]
关闭环回接口:                                             [确定]
弹出环回接口:                                             [确定]
弹出界面 eth0: Determining if ip address 192.168.170.136 is already in use for device eth0...
                                                           [确定]
[root@Server ~]#

出现报错问,下面解决报错:

在网卡配置文件里添加一条ARPCHECK=no,是arp检查导致的关闭就可

[root@Server ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0
HWADDR=00:0C:29:6F:D7:6E
TYPE=Ethernet
UUID=14e3be88-e1a9-4ebd-bea3-6d337b161e10
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.170.136
NETMASK=255.255.255.0
GATEWAY=192.168.170.2
DNS1=192.168.170.2
ARPCHECK=no

添加完成,重启一下看看。

[root@Server ~]# service network restart
正在关闭接口 eth0:                                        [确定]
关闭环回接口:                                             [确定]
弹出环回接口:                                             [确定]
弹出界面 eth0:                                            [确定]
[root@Server ~]#

没有报错了