Wake on WAN stops working sometimes

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
alirz
DD-WRT User


Joined: 27 Apr 2007
Posts: 61

PostPosted: Tue Nov 25, 2014 20:51    Post subject: Wake on WAN stops working sometimes Reply with quote
Hi Everyone,
I have a strange issue. So i've been using/running dd-wrt on my wrt-610n2 for years. Its been perfectly fine.

I have WOL setup over the internet. It normally works fine and has been for years.
However over the past year, once a month or so, it stops working. If i reboot the router it starts working again.

Here are some points:
- Running dd-wrt build 21676 on my wrt-610n V2 router
- I have a static IP address.
- Router is connected to my cable modem.
- When wol doesnt work, if i take a tcpdump on the router, i dont see the wol packets hitting the router.
- SPi firewall is disbaled.
-Nothing in the DMZ
- All port forwarding stuff is correct.

Any ideas?


Last edited by alirz on Tue Nov 25, 2014 21:41; edited 2 times in total
Sponsor
alirz
DD-WRT User


Joined: 27 Apr 2007
Posts: 61

PostPosted: Tue Nov 25, 2014 21:34    Post subject: Reply with quote
basically using the "ip neigh" commands in the "startup" section of dd-wrt e.g

ip neigh add 192.168.1.254 lladdr E0:63:95:D8:D7:E1 nud permanent dev br0

and then from WAN side port forwarding incoming wol port to that ip address on the lan side.

For whatever its worth, i've zero issues with it and no caveats, atleast not in my case. I infact have wake on wan setup for multiple pcs on my lan and it normally works fine except when this werid situation occurs that breaks it for all the pcs.
NOTE, wake on LAN (inside the lan) still works fine.

Im starting to wonder if my modem has anything to do with it. Rebooting the router maybe clears something in the router's memory??
alirz
DD-WRT User


Joined: 27 Apr 2007
Posts: 61

PostPosted: Tue Nov 25, 2014 22:33    Post subject: Reply with quote
Thanks for the reply. I appreciate your input.
I see your point and i read the "updated" wiki page you linked. Those instructions were not there back when i setup the wake on wan based on the instructions from the dd-wrt wiki.

I noted that the wiki does say that "ip neigh" support was removed as of dd-wrt 17650. I did my setup in 13xxx days. 2007 i think, as thats when i joined the dd-wrt forum specifically looking for this setup. I guess i never bothered to look at the wiki for future dd-wrt versions. I never thought WOL behaviour would be changed.

Even if my setup is now deemed incorrect, it does work 99% of the time.I prefer to NOT use any online service for sending the wol packets. I have a WOL app on my smart phone that i've used since forever and it does the job. Heck, even team viewer from my PC can wake up my remote pcs.
I can selectively turn on my computers even from a powered off state(bios dependant of course) over the internet.

I've never really trouble shooted this issue further other than taking a tcpdump on the router. The fact that the tcpdump does not even show the incoming UDP packet, i have a feeling somethings happening to it at the modem level somehow. Maybe I'll reboot my modem. It's been up for years.

you are correct. I do have multiple entries for "ip neigh" and also multiple port forwarding to multiple broadcast ips .252,.253,.254 on their respective ports.
alirz
DD-WRT User


Joined: 27 Apr 2007
Posts: 61

PostPosted: Wed Nov 26, 2014 16:10    Post subject: Reply with quote
So today again it stopped working. This week, its pretty much stopped every day.
I've tried multiple sending sides so that can be ruled out.
I think i will go ahead and try the setup as recommended in the new wiki
Mile-Lile
DD-WRT Guru


Joined: 24 Feb 2013
Posts: 1634
Location: Belgrade

PostPosted: Thu Nov 27, 2014 7:22    Post subject: Reply with quote
Why not use ddwrt as VPN server, and then WOL from GUI of ddwrt?
alirz
DD-WRT User


Joined: 27 Apr 2007
Posts: 61

PostPosted: Thu Nov 27, 2014 14:53    Post subject: Reply with quote
[quote="Mile-Lile"]Why not use ddwrt as VPN server, and then WOL from GUI of ddwrt?[/quote]

that would involve too many steps to wake up a computer. Complicated for no reason.THanks
ekirscht
DD-WRT Novice


Joined: 07 Feb 2018
Posts: 2

PostPosted: Wed Feb 07, 2018 1:41    Post subject: v3.0-r34777 std does the same thing (or only works once) Reply with quote
I just got a new router and loaded Firmware: DD-WRT v3.0-r34777 std (01/31/18 ). I too found that I had to change the start up commands to something like this based on the updated WOL instructions for DD-WRT:

arp -i br0 -s 192.168.1.xxx FF:FF:FF:FF:FF:FF

I'm not putting what the actual IP address that I use in this document. That's why you see 192.168.1.xxx above (and later below). You would have to put what IP address you have assigned to the workstation that you're trying to wake up. And no it doesn't have to be 254 (or 192.168.1.254). I've used something other than that for years and it works fine. I put a static IP for the actual MAC address of the workstation I'm waking up under "Static Leases" under the "Services" tab.

I was so happy when I got everything configured because the Linksys router (330N think) that I was using previously took a power surge last year and then wouldn't come back up. I had to quickly replace it with a different model and whoa, the Linksys models that would take DD-WRT were hundreds of dollars so I shelved doing WOL and got a cheap Linksys router until this past month.

Well, after putting in the new command above it worked only once and then stopped working after I shut the workstation down. I wake mine up over the Internet via an app on my phone. It's an iPhone app by "Banana Glue" called "iNet WOL".

Like you it worked fine for years before I had to get a new router and configure a newer one that actually supports DD-WRT. I got the TP-Link Archer C7 for $59 on Amazon.com. Unfortunately they spiked the price up by $10 recently so it actually sells for $69 now. Regardless, I love it so far and it is super fast compared to what I had with my Linksys router. I'm not dropping $250 for a Linksys router to do WOL.

Well, I've done some theory checking and I figured it out (or at least a workaround). I went to the "Commands" tab under the "Administration" tab and popped in the command above and clicked the "Run Commands" button and then guess what, all of the sudden it started waking up again over the internet.

Earlier this evening, I tried to wake it up over the internet from my phone and it didn't work. I think that perhaps that arp table setting gets cleared out periodically. Perhaps if it doesn't see the IP address actively connected to the router. Possibly when the network interface card actually wakes up and communicates its real MAC address to the router the ARP setting gets overwritten. It's just an educated guess, and like the documentation states, you need to keep that arp MAC address set to FF:FF:FF:FF:FF:FF in order for the magic packet to work.

Thankfully I know all about crontab because I use it every day at work and I've set it to execute that command on the router every 5 minutes. That way if it magically forgets the arp setting, in 5 minutes it will be re-established, thus putting it in a state where I can wake up my workstation like I wanted.

I temporarily activated the sshd to find the full path to arp. So here is the command that I put into the "Cron" section of the "Management" tab under the Administration tab:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /bin/sh /usr/sbin/arp -i br0 -s 192.168.1.xxx FF:FF:FF:FF:FF:FF

I borrowed from examples posted by others to create my crontab line above. At first I set it like this (which will run that command every minute):

* * * * * root /bin/sh /usr/sbin/arp -i br0 -s 192.168.1.xxx FF:FF:FF:FF:FF:FF

I'm not sure if it will stay in the cron section after the router is rebooted. I suspect it will, but if not I'll put it back in manually if I need to.

Immediately after I hit the "Save" button and then the "Apply Settings" button at the bottom of the page within a minute I sent the magic packet over the internet and it woke up my workstation.

I'm curious to see how it pans out tomorrow evening when I try it.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed Feb 07, 2018 10:02    Post subject: Reply with quote
I don not know if this applies to this situation but there were reports that "ip neigh" was no longer working in the latest builds.
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed Feb 07, 2018 10:18    Post subject: Reply with quote
What I understand is that iproute2 is no longer included but that ip commands are done with busybox ?

I just checked: in build 34320 "ip neigh" was working in the latest 34790 it is gone Sad

I think Kong is aware of the situation, lets hope for a fix soon

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed Feb 07, 2018 10:33    Post subject: Reply with quote
PBR, port forwarding, QOS, DMZ are working again in the latest version of Kong: 34790M
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
ekirscht
DD-WRT Novice


Joined: 07 Feb 2018
Posts: 2

PostPosted: Thu Feb 08, 2018 3:27    Post subject: I figured out why the arp only lets WOL work only once Reply with quote
Thanks to feedback from eibgrad and others I was able to prove my theory correct. Basically, the watch command isn't available in the DD-WRT terminal, but I could do "arp -a" and it lists the whole ARP table.

I took the commands out of the start up portion of the "Commands" tab under the "Administration" tab and went exclusively with the cron job solution, and it worked!

I think I might put my shell scripting skills to work and produce / post a solution to this so people can use arp and cron together. I might want to explore the "Save Custom Script" and call it from the cron job section.

So basically when I set the arp table for the workstation to FF:FF:FF:FF:FF:FF it gets overwritten with the actual value of the mac address of the network card after the workstation wakes up and communicates to the router.

Then when I power down the workstation, the arp is stuck with the existing network card mac address (and not the FF:FF:FF:FF:FF:FF value that you need to wake it back up with) and then is no longer accessible to be woken up with the magic packet over the internet. Either that, or combined with the fact that the arp table notices that the mac address has gone off line it flushes that entry from the table.

Also, I noticed that from my previous posting yesterday that I had a mistake in the location of the arp. It is actually "/sbin/arp" and not "/usr/sbin/arp". So here is what I have now under the "Cron" portion of the "Management" tab under "Administration":

0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /sbin/arp -i br0 -s 192.168.1.254 FF:FF:FF:FF:FF:FF

Again you would have to put what IP address that you have assigned to your network card in place of 192.168.1.254 above.

Surprisingly, the 5 minute interval of the cron job sets the mac address back to FF:FF:FF:FF:FF:FF, and while the workstation is online it still appears to work fine.

Ideally when I write a shell script I'm going to combine what I learned from eibgrad and write something that polls for the FF:FF:FF:FF:FF:FF in the arp table and if it is missing, and the IP address is not there then I will set it back to FF:FF:FF:FF:FF:FF. I would have to do some more theory testing with the script. But I know I can do it. I write complex shell scripts all of the time in unix / linux.

Then I would write it so the cron job checks it every minute, and it will only issue the arp setting to FF:FF:FF:FF:FF:FF if the host is offline or it is missing from the arp table.

In the meanwhile I have my WOL back and working. I can always make it better. When I do it I'm going to share it so everyone can benefit from the solution.

Thanks for everyone's help! Together we can do it and make a difference.

I'll be back!
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum