天天看點

OpenwrtWOL廣域網中遠端喚醒計算機故障排查最後将arp綁定指令添加進開機啟動腳本

廣域網中遠端喚醒計算機故障排查

    • 檢視arp資訊,注意Flags
    • arp狀态有permanent | noarp | stale | reachable
    • 将伺服器的arp資訊更改成永久即可解決
    • 再次檢視arp資訊,注意Flags
    • 區域網路etherwake喚醒伺服器,成功
  • 最後将arp綁定指令添加進開機啟動腳本

檢視arp資訊,注意Flags

[[email protected]:/root]#arp
IP address       HW type     Flags       HW address            Mask     Device
192.168.1.2      0x1         0x2         00:0b:2f:xxxxxx     *        br-lan
           

arp狀态有permanent | noarp | stale | reachable

[[email protected]:/root]#ip neigh help
Usage: ip neigh { add | del | change | replace } { ADDR [ lladdr LLADDR ]
          [ nud { permanent | noarp | stale | reachable } ]
          | proxy ADDR } [ dev DEV ]
       ip neigh {show|flush} [ to PREFIX ] [ dev DEV ] [ nud STATE ]
           

将伺服器的arp資訊更改成永久即可解決

[[email protected]:/root]#ip neigh change 192.168.1.2 lladdr 00:0b:2f:xxxxxxxx nud permanent  dev br-lan
           

再次檢視arp資訊,注意Flags

[[email protected]:/root]#arp
IP address       HW type     Flags       HW address            Mask     Device
192.168.1.2      0x1         0x6         00:0b:2f:xxxxxx     *        br-lan
           

區域網路etherwake喚醒伺服器,成功

[[email protected]:/root]#etherwake help
usage: ether-wake [-i <ifname>] [-p aa:bb:cc:dd[:ee:ff]] 00:11:22:33:44:55
   Use '-u' to see the complete set of options.
[[email protected]:/root]#etherwake -i br-lan 00:0b:2f:xxxxxx 
           

最後将arp綁定指令添加進開機啟動腳本

[[email protected]:/root]#cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
/usr/bin/ip neigh change 192.168.1.2 lladdr 00:0b:2f:xxxxxxxx  nud permanent  dev br-lan
 
exit 0
           

繼續閱讀