5
2
The title say it all, but here is the long version:
I am trying to setup a way for my home server to automatically turn on using WakeOnLan, when a client tries to access it. My idea is that the router (OpenWRT 14.07, Barrier Breaker) monitors any connection attempts to the host I want to wake up using iptables
and in the case it registers such an event it sends the magic packet to wake the host. After lots of trying and help on SF, I have gotten iptables to work for the bridged device and thus local network (see here).
Unfortunately I now ran into the problem that, if the host is turned off, no ARP entry exists for it and thus local clients will not send any packets, when they cannot resolve the IP (if I have understood the problem correctly). For external clients accessing from the internet it works.
If I understand correctly, the solution should be to create a static ARP entry, so that the router will respond to any requests and then the clients will send their packet. Following this I have tried using the ip neigh add 192.168.1.20 lladdr 00:de:ad:be:ef:00 nud permanent dev br-lan
and running arp
I see an entry for the server, but it still does not work.
I have confirmed, that when the server is turned on or was recently turned off (a few minutes prior), the clients do send packets, which are logged by iptables
.
So the questions are:
1) What am I doing wrong?
2) How do I achieve a static/persistent ARP entry on the?
1You need
ip-full
package installed for these commands to work. – Sourav Ghosh – 2018-07-20T12:01:07.500