linux上 管理arp的一些工具

来源:互联网 发布:淘宝店铺异常,状态码-2 编辑:程序博客网 时间:2024/06/13 03:34

arp table cache


1. arp -n  显示arp table

arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
9.115.251.1              ether   00:00:0c:07:ac:1b   C                     eth0


2. 删除某个arp表项

arp -d 9.115.251.1


3. 设置某个arp表项

# arp -s 9.115.251.20 00:00:0c:07:ac:cc
# arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
9.115.251.1              ether   00:00:0c:07:ac:1b   C                     eth0
9.115.251.20             ether   00:00:0c:07:ac:cc   CM                    eth0

发送arp包, arping

1. 广播谁有某个ip地址

arping  9.115.251.1


2. 指定端口发送

arping -I eth0 9.115.251.1


3. 指定发送次数

arping -c 2 -I eth0 9.115.251.1


抓arp包


好了,我们需要验证一下到底有木有发送arp,收到arp


tcpdump -i eth0 -p arp