I am using WOL to power on a device on the local network. After some time, the MAC address of this device is deleted from the ARP cache, so to use WOL for this device again I have to add this address with e.g.: # ip neigh replace 192.168.100.100 dev enp23s25 lladdr aa:bb:cc:dd:ee:ff
Of course then it works. But I want this to happen automatically after booting, for more comfort.
My only approach is to use systemd timers or cronjob, but there would be a security risk, right?
The command I use to wake up the device is: wol --host= 192.168.100.100 aa:bb:cc:dd:ee:ff
I can´t find an option to send a broadcast, so I guess the mac-address ff:ff:ff:ff:ff:ff is what you mean? besides that it would not be useful in my opinion since this could potentially wake up all wol device on the network, right?
–ipaddr=HOST
Broadcast packet to this IP address or hostname. This is important if your wol client is a multihomed host and you want to send only to one subnet (default IP address is 255.255.255.255).
Try using --ipaddr instead of --host
wol --ipaddr=192.168.100.100 aa:bb:cc:dd:ee:ff
Also, not sure if it was a typo or if it’s the actual line you use, but remove the space between = and ip
Thank you for the replies.
You are right, that´s a typo in the command I posted. However, after I reboot my Computer the ARP cache is flushed. Alternatively this can be done with the ip neigh flush command aswell.
ip neigh doesn´t show the device I want to wake up, and thats the problem. Without the MAC I can not send the package to the destination.
Perhaps, maybe I got it wrong? I suppose I need to have the MAC in the ARP cache.