Linux 绑定ARP
假如 192.168.1.1 是我的网关

[root@localhost ~]# ping 192.168.1.1

[root@localhost ~]# arp
Address                     HWtype  HWaddress               Flags Mask            Iface
192.168.1.1              ether      00:19:E0:F4:30:2A     C                        eth0

网关的MAC   00:19:E0:F4:30:2A
Flags Mask    C   (表示为静态)

[root@localhost ~]# echo "192.168.1.1 00:19:E0:F4:30:2A" >/etc/ethers

把网关IP和MAC地址写入到 /etc/ethers

[root@localhost ~]# arp -f

[root@localhost ~]# arp
Address                     HWtype  HWaddress               Flags Mask            Iface
192.168.1.1              ether      00:19:E0:F4:30:2A     CM                      eth0

Flags Mask为 CM (静态网关 表示绑定成功)

如果可以的话最好是做双向绑定
游客 | 登入