”arp -s “与"netsh"都可实现IP/MAC绑定,通常,"arp -s "用于较简单情况下,"netsh"用于更为复杂的环境,功能更为强大。
二者明显的区别在于:
"arp -s"只能实现临时性IP/MAC绑定,重启系统后,绑定失效;
而"netsh"则可实现永久性IP/MAC绑定,重启系统后任有效,并且可以指定网络接口。
1、arp(临时性)
arp -a
arp -s ip mac(xx-xx-xx)
2、netsh
netsh i i show in #netsh interface ipv4 show interfaces,查看本地网卡对应的"Idx"值,管理员权限
![](https://img.haomeiwen.com/i4809537/53be09b7e6a3ca46.png)
netsh -c i i add ne Idx(我电脑上是4) IP Mac(xx-xx-xx) #netsh -c "interface ipv4" add neighbors
#netsh -c i i add ne Idx IP Mac(xx-xx-xx) store=active表示临时绑定
#netsh -c i i del ne Idx 删除静态绑定
![](https://img.haomeiwen.com/i4809537/2a6fedc5b3dc81bb.png)
![](https://img.haomeiwen.com/i4809537/fe8ead287cb75895.png)
网友评论