
1、系统初始arp环境\x0d\x0a[root@esx ~]# arp -n\x0d\x0aAddress HWtype HWaddress Flags Mask Iface\x0d\x0a192.168.1.175 ether 00:24:1D:97:B6:7F C vswif0\x0d\x0a192.168.1.120 ether 00:1F:C6:3A:DC:81 C vswif0\x0d\x0a192.168.1.51(incomplete) vswif0\x0d\x0a\x0d\x0a2、执行
清除所有arp
缓存命令\x0d\x0a[root@esx ~]# arp -n|awk '/^[1-9]/{print "arp -d " $1}'|sh -x\x0d\x0a+ arp -d 192.168.1.175\x0d\x0a+ arp -d 192.168.1.120\x0d\x0a+ arp -d 192.168.1.51\x0d\x0a\x0d\x0a3、执行
命令后,本机arp缓存信息\x0d\x0a[root@esx ~]# arp -n\x0d\x0aAddress HWtype HWaddress Flags MaskIface\x0d\x0a192.168.1.175 (incomplete)vswif0\x0d\x0a192.168.1.120 (incomplete)vswif0\x0d\x0a192.168.1.51 (incomplete) vswif0这是网上一篇教程
arp缓存就是IP地址和MAC地址关系缓存列表。在Windows下 arp -d [$ip] 不指定IP地址时清除所有arp缓存。在Linux下 arp -d $ip 必须指定IP地址才能执行这条命令的此参数,所有在Linux系统下 arp -d $ip 命令只能清除一个IP地址的对应MAC地址缓存,当然可以使用组合命令 *** 作,这也算是Linux的一个优点吧。
组合命令清除所有arp缓存:arp -n|awk '/^[1-9]/{system("arp -d "$1)}'其实Linux也有内部命令清除所有arp缓存,但是不太好记忆,用的人很少。以下命令清除eth0接口的所有arp缓存。ip neigh flush dev eth0
评论列表(0条)