arp命令 清arp表

平常删除arp都用arp-d。大量存在的时候 arp -n|awk '/^[1-9]/ {print arp -d $1}' | sh 清除所有arp表,以前用这个来清arp表貌会清空,没注意到存在incomplete。 今天同事发现arp-d后arp表中是incomplete。在大量IP的时候,arp-d就会存在大量的incomplete。

平常删除arp都用arp -d。大量存在的时候
arp -n|awk '/^[1-9]/ {print "arp -d "$1}' | sh
清除所有arp表,以前用这个来清arp表貌似会清空,没注意到存在incomplete。
今天同事发现arp -d后arp表中是incomplete。在大量IP的时候,arp -d就会存在大量的incomplete。这个要arp到期了才会消失。但是arp表满了,无法ping了。这个时候需要如何解决呢?
发现用ip link set arp off/on来解决是最好的。
[root@localhost sbull]# arp -n
Address HWtype HWaddress Flags Mask Iface
10.66.20.38 ether 18:03:73:AF:A7:49 C eth0
10.66.255.254 ether 10:8C:CF:20:85:C4 C eth0
[root@localhost sbull]# arp -d 10.66.20.38
[root@localhost sbull]# arp -n
Address HWtype HWaddress Flags Mask Iface
10.66.20.38 (incomplete) eth0
10.66.255.254 ether 10:8C:CF:20:85:C4 C eth0
[root@localhost sbull]# arp -d 10.66.20.38
[root@localhost sbull]# arp -n
Address HWtype HWaddress Flags Mask Iface
10.66.20.38 (incomplete) eth0
10.66.255.254 ether 10:8C:CF:20:85:C4 C eth0
[root@localhost sbull]# ip link set arp off dev eth0
[root@localhost sbull]# ip link set arp on dev eth0
[root@localhost sbull]# arp -n
[root@localhost sbull]# 
本文链接http://www.cxybl.com/html/czxt/linux/20130112/35993.html
posted @ 2015-06-25 13:41  周人假的  阅读(5135)  评论(0编辑  收藏  举报