如题所示,具体的问题如下图所示:
关于这个问题,有可能是以下两种原因造成的:
1. 你的网络里真的有一台服务器的IP,跟你当前期望的IP冲突。
2. 你的本地机器曾经配置过你期望的IP。
解决方法有很多种:
一、注释:ifup-eth
修改ifup-eth之前,先做备份:
[root@PRODUCT42 ~]# mkdir /backup [root@PRODUCT42 ~]# cp /etc/sysconfig/network-scripts/ifup-eth /backup/ [root@PRODUCT42 ~]# [root@PRODUCT42 ~]# cat /etc/sysconfig/network-scripts/ifup-eth | wc -l 323 [root@PRODUCT42 ~]# [root@PRODUCT42 ~]#
然后,如下图所示:
注释掉,包含:
net_log $”Error, some other host ($ARPINGMAC) already uses address ${ipaddr[$idx]}.”
的那一小段:if … fi,的代码段。
然后,重启网卡,就不会遇到文首截图中所遇到的问题了:
[root@PRODUCT42 ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:50:56:AA:54:87 inet6 addr: fe80::250:56ff:feaa:5487/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:227319 errors:0 dropped:0 overruns:0 frame:0 TX packets:1186 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:33744807 (32.1 MiB) TX bytes:302184 (295.1 KiB) eth1 Link encap:Ethernet HWaddr 00:50:56:AA:28:C2 inet addr:192.168.3.31 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:feaa:28c2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:27309 errors:0 dropped:0 overruns:0 frame:0 TX packets:2020 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1759553 (1.6 MiB) TX bytes:224418 (219.1 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2580 errors:0 dropped:0 overruns:0 frame:0 TX packets:2580 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:198944 (194.2 KiB) TX bytes:198944 (194.2 KiB) [root@PRODUCT42 ~]# [root@PRODUCT42 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet UUID=ba4466c2-fd24-484c-bb40-71a98a8b67eb ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=none HWADDR=00:50:56:AA:54:87 PREFIX=24 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth0" LAST_CONNECT=1467738912 IPADDR=192.168.0.41 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 [root@PRODUCT42 ~]# [root@PRODUCT42 ~]# ifdown eth0 [root@PRODUCT42 ~]# [root@PRODUCT42 ~]# ifup eth0 Determining if ip address 192.168.0.41 is already in use for device eth0... [root@PRODUCT42 ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:50:56:AA:54:87 inet addr:192.168.0.41 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:feaa:5487/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:228195 errors:0 dropped:0 overruns:0 frame:0 TX packets:1336 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:33871362 (32.3 MiB) TX bytes:311622 (304.3 KiB) eth1 Link encap:Ethernet HWaddr 00:50:56:AA:28:C2 inet addr:192.168.3.31 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:feaa:28c2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:27856 errors:0 dropped:0 overruns:0 frame:0 TX packets:2252 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1800693 (1.7 MiB) TX bytes:249555 (243.7 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:2730 errors:0 dropped:0 overruns:0 frame:0 TX packets:2730 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:215756 (210.6 KiB) TX bytes:215756 (210.6 KiB) [root@PRODUCT42 ~]#
如果,你连:
Determining if ip address 192.168.0.41 is already in use for device eth0…
这个告警信息都不想看到,你可以注释得更彻底一点:
二、清理ARP列表。
[root@PRODUCT42 ~]# arp -n Address HWtype HWaddress Flags Mask Iface 192.168.0.21 ether c8:1f:66:c7:4b:8f C eth0 192.168.3.1 ether f8:c2:88:1b:20:cd C eth1 [root@PRODUCT42 ~]# [root@PRODUCT42 ~]# arp -d 192.168.0.21 [root@PRODUCT42 ~]# [root@PRODUCT42 ~]# arp -n Address HWtype HWaddress Flags Mask Iface 192.168.0.21 (incomplete) eth0 192.168.3.1 ether f8:c2:88:1b:20:cd C eth1 [root@PRODUCT42 ~]#
注意,ARP清理,是将列表条目标记为:(incomplete),并等待下次Linux系统的垃圾清理,予以清除。
三、禁用ARP检查:
[root@PRODUCT42 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 | grep --color ARPCHECK ARPCHECK=no [root@PRODUCT42 ~]#
——————————————
Done。