小小程序猿
这个人很懒,什么都没写
Toggle navigation
小小程序猿
主页
关于
友链
归档
标签
linux-arp
linux
2021-11-10 11:16:13
23
0
0
terry
linux
## 查看局域网的ip和mac地址 ```bash [houge@gmv6 ~]$ arp -h Usage: arp [-vn] [<HW>] [-i <if>] [-a] [<hostname>] <-Display ARP cache arp [-v] [-i <if>] -d <host> [pub] <-Delete ARP entry arp [-vnD] [<HW>] [-i <if>] -f [<filename>] <-Add entry from file arp [-v] [<HW>] [-i <if>] -s <host> <hwaddr> [temp] <-Add entry arp [-v] [<HW>] [-i <if>] -Ds <host> <if> [netmask <nm>] pub <-''- -a display (all) hosts in alternative (BSD) style -e display (all) hosts in default (Linux) style -s, --set set a new ARP entry -d, --delete delete a specified entry -v, --verbose be verbose -n, --numeric don't resolve names -i, --device specify network interface (e.g. eth0) -D, --use-device read <hwaddr> from given device -A, -p, --protocol specify protocol family -f, --file read new entries from file or from /etc/ethers <HW>=Use '-H <hw>' to specify hardware address type. Default: ether List of possible hardware types (which support ARP): ash (Ash) ether (Ethernet) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE) arcnet (ARCnet) dlci (Frame Relay DLCI) fddi (Fiber Distributed Data Interface) hippi (HIPPI) irda (IrLAP) x25 (generic X.25) infiniband (InfiniBand) eui64 (Generic EUI-64) ``` ## arping 绑定ip和mac ```bash arpingarping -c 1 -w 3 -D -I em1 192.168.100.120 arping -q -A -c 1 -I em1 192.168.100.120 arping -q -U -c 1 -I em1 192.168.100.120 ip addr change 192.168.100.120 dev em1 valid_lft forever preferred_lft forever arping 参数说明 -A:与-U参数类似,但是使用的是ARP REPLY包而非ARP REQUEST包。 -b:发送以太网广播帧,arping在开始时使用广播地址,在收到回复后使用unicast单播地址。 -c:发送指定的count个ARP REQUEST包后停止。如果指定了-w参数,则会等待相同数量的ARP REPLY包,直到超时为止。 -D:重复地址探测模式,即,Duplicate address detection mode (DAD),用来检测有没有IP地址冲突,如果没有IP冲突则返回0。 -f:收到第一个响应包后退出。 -h:显示帮助页。 -I:用来发送ARP REQUEST包的网络设备的名称。 -q:quite模式,不显示输出。 -U:无理由的(强制的)ARP模式去更新别的主机上的ARP CACHE列表中的本机的信息,不需要响应。 -V:显示arping的版本号。 -w:指定一个超时时间,单位为秒,arping在到达指定时间后退出,无论期间发送或接收了多少包。在这种情况下,arping在发送完指定的count(-c)个包后并不会停止,而是等待到超时或发送的count个包都进行了回应后才会退出。 -s:设置发送ARP包的IP资源地址,如果为空,则按如下方式处理: 1、DAD模式(-D)设置为0.0.0.0; 2、Unsolicited模式(-U)设置为目标地址; 3、其它方式,从路由表计算。 ```
上一篇:
js xhr
下一篇:
linux-tcpdump
0
赞
23 人读过
新浪微博
微信
腾讯微博
QQ空间
人人网
提交评论
立即登录
, 发表评论.
没有帐号?
立即注册
0
条评论
More...
文档导航
没有帐号? 立即注册