现在的位置: 首页 > 综合 > 正文

linux上 管理arp的一些工具

2012年12月15日 ⁄ 综合 ⁄ 共 648字 ⁄ 字号 评论关闭

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

抱歉!评论已关闭.