DD-WRT 'Wake on Lan' setup help?

dr.stevil

[H]F Junkie
2FA
Joined
Sep 26, 2008
Messages
9,315
So I have a Netgear R7000 router that I've been having a lot of problems with (mostly restarts and dropped connections). I finally decided to flash it to DD-WRT, but before doing so, I had successfully setup Wake-on-Lan on the stock firmware. It worked flawlessly from inside my LAN and from outside the network. So I know that the BIOS/EFI and network adaptor was all setup properly.

So anyway, since going to DD-WRT, the router is rock solid... I honesty couldn't be happier. I've been researching the WOL abilities of this firmware, as it's a LOT more robust/advanced than the Netgear firmware (on the Netgear FW, I only had to enable it and forward the port to the machine I wanted to wake up... In contrast to all the options on DD-WRT).

So I gave it a try and I can get the machine to wake from inside the LAN, but can't seem to get it to wake up from outside the network. I read the wiki along with some forum posts regarding configuring WOL on DD-WRT, but it was way above my head. IIRC, it says to forward the port to an unused IP (ex 192.168.1.254)... But this confuses me since the IP of the machine I want to wake is 192.168.1.2.

Also, it says that I should be forwarding port 6 (most commonly used for WOL apparently) but I'm using splashtop and it uses port 6735 (I believe). So at this point aim really confused and was hoping someone could help explain it. If DD-WRT wants me to forward the port to 192.168.1.254, how does it know which machine on the LAN to wake?
 
Last edited:
I still have the config on a DDWRT router I mange for somebody. IF above does not work I'll check it out for you.

The problems with WakeOnWan is (if BIOS and Windows network adapter settings are ok as you say) are usually:

1) Does not work over Wifi (unless specific drivers)
2) There has been a power outage or the computer was otherwise disconnected from power. WOL-settings often reside in volatile storage on the network card. The settings to allow WOL get REapplied when Windows boots successfully. Hence, WOL will not work the first time after a power outage.

That having said. The technical reason what is missing is that the router needs the MAC-address for 192.168.1.2. If that system is powered off, it cannot reply to the router and give it its MAC-address. What is needed, is called static ARP-binding. DHCP reservation may or may not configure static ARP-binding as a bonus.

The solution, static ARP-binding, is to tell the router that 192.168.1.2 has the MAC-address of (making one up here) AB-BA-AB-BA-AB-BA. That way, the router knows how to forward your WOL packet , even when the machine is powered of. Since WOL is a broadcast (every pc gets the packet), the IP does not truly matter. As long as the packet gets flooded to the correct subnet.

That is why DDWRT manuals say you can use an unused IP. I know I reiterate, but what the router will do is forward the WOL packet onto the subnet. The PC that recognizes its MAC will boot. All other will remain powered off.

I hope above helps you to get a better understanding. If not, do ask!
 
Last edited:
Ok. So if I understand you correctly, I want to forward the ports used by Splashtop (6783, 6784 and 6785) to 192.168.1.2 (the computer I'm trying to wake up)? Then, I want to forward port 9 to 192.168.1.255?

I have my computer selected as a WOL host per the WOL DD-WRT setup page. Here is an image showing what I'm trying to do. Does it look ok? Likewise, I added a screen shot of the port forwarding rules.

 
YAYYYYYY!@!!@@@@@!!!!



lol it worked. Thanks for all the help guys.

So I have a stupid question though... how do you tell the computer or router which WOL port to use? Or is it always port 9? I've read that it can technically be any port (or I misunderstood what I read). Reason I ask is that, like I said earlier, I never had to configure that with my previous firmware. I'm just trying to wrap my head around the process and why it works the way that it does.

Happy as hell that it works. Thanks again guys
 
I see you did it with a subnet directed broadcast (.255 indicates the subnet broadcast address).

In most routers this is blocked. Just so you know this working is rather an exception on consumer gear.

You can select any port you want to forward. I would even suggest to change it to something well above 1024.

Good to see it working!


ps: also please test when the computer has been OFF for 10-20 minutes. It may be that the ARP-entries in the router time out, and WOL over WAN will stop working then.
Just in case the directed broadcast does not work as advertised :)

BIG EDIT:

Ah, I understand now. You are using WOL from the ROUTER's config page?

In that case, no port forwarding for WOL is needed at all. The router is then on the same subnet as your computer. You are NOT using wake on WAN. The Wake on WAN I am talking about can, for instance, be used from a computer at work using an application. I.E. without exposing your router's webinterface to the big bad internet.
 
I see you did it with a subnet directed broadcast (.255 indicates the subnet broadcast address).

In most routers this is blocked. Just so you know this working is rather an exception on consumer gear.

You can select any port you want to forward. I would even suggest to change it to something well above 1024.

Good to see it working!

Ok, so if I understand, the subnet broadcast is always designated to .255? IIRC, in the past, I tried assigning that IP to a device on my network and it wouldn't let me... 254 and lower worked though. I never bothered to try to find out why lol

I'm guessing since DD-WRT is a bit more advanced, it allows this? Or does it depend on certain hardware configurations to function? (ie, would this work on any router running DD-WRT?)

As for changing the WOL port, how would I do that? I originally had it set to 6, and it wouldn't work. I had to change the forwarded port to 9 to get it to function properly from outside my LAN... so I would assume that 1024 wouldn't work either. :confused: I can't find any setting on the firmware that will allow me to change the WOL packet to a different port. Or do I configure it on the network adapter, on the machine I want to wake up?

ps: also please test when the computer has been OFF for 10-20 minutes. It may be that the ARP-entries in the router time out, and WOL over WAN will stop working then.
Just in case the directed broadcast does not work as advertised :)

Thanks for the heads up. I'll try testing this later. That would of been aggravating to try to figure out on my own lol

BIG EDIT:

Ah, I understand now. You are using WOL from the ROUTER's config page?

In that case, no port forwarding for WOL is needed at all. The router is then on the same subnet as your computer. You are NOT using wake on WAN. The Wake on WAN I am talking about can, for instance, be used from a computer at work using an application. I.E. without exposing your router's webinterface to the big bad internet.

No, I'm not using the router to wake the machine, but apparently when I enabled WOL for the 192.168.1.2 machine, it automatically gives the ability to wake the machine from the DD-WRT web front end. That is one of the things that actually confused me at first when I tried setting this up.

I have the web administration disabled on the router... If I ever need to access it remotely, I just use RDP software (Splashtop) to access the router from inside the LAN. I also use the Splashtop client to initiate WOL.
 
Ok, so if I understand, the subnet broadcast is always designated to .255? IIRC, in the past, I tried assigning that IP to a device on my network and it wouldn't let me... 254 and lower worked though. I never bothered to try to find out why lol

I'm guessing since DD-WRT is a bit more advanced, it allows this? Or does it depend on certain hardware configurations to function? (ie, would this work on any router running DD-WRT?)

No, it is not always .255. It depends on your subnet mask. You are using a /24? That means that 192.168.1 is the fixed part. The last number can go from 1 to 255, 192.168.1.255 being the broadcast address for that subnet. 192.168.1.0 is called the network address.
I won't go into details here unless needed.

Everyone that knows the port you use to WOL, could potentially flood your network with broadcasts. That is why most routers do not forward an IP subnet directed broadcast by default. Whether or not it does, depends on the firewall settings. Some routers allow you to change the configuration of the firewall so that IP subnet directed broadcasts are allowed. So, whether it works or not, is entirely up to the router firmware. DDWRT might allow it, Tomato (other firmware) might not.
Often it is off by default without any way to enable it (= as is the case with most consumer gear with stock firmware).


As for changing the WOL port, how would I do that? I originally had it set to 6, and it wouldn't work. I had to change the forwarded port to 9 to get it to function properly from outside my LAN... so I would assume that 1024 wouldn't work either. :confused: I can't find any setting on the firmware that will allow me to change the WOL packet to a different port. Or do I configure it on the network adapter, on the machine I want to wake up?

You would just change 'port from' and 'port to' in that first screenshot you posted. a WOL-packet is a L2 broadcast, it does not care about port numbers. A port just allows you to get packets through the firewall and flooded to the correct subnet. IT _could_ be that DDWRT's firewall will only allow port 9 to be used in conjunction with an IP subnet directed broadcast. The GUI does not show you all firewall rules. So, I'm just making a guess here. If it stops working when you use another port (8000 for instance) and then it works again with port 9 you could conclude the firewall is 'the culprit"

I'm still a bit surprised DDWRT allows it to pass. My old Linksys (still deployed somewhere) with an older version of DDWRT did not allow that (for good reason!). Then again, I never used port 9 to test with.
 
Last edited:
Thanks for the help and bearing with me. It's much appreciated.

So as far as WOL, is the way that I have it configured not a good idea (for security reasons)? That's the only way that I've been able to find to enable it on my router with DDWRT, but again, I'm far from a network guru. Trying to learn though

I should also note that I had a bunch of issues with it yesterday anyway. Like I said before, I was able to get it working, both via the LTE connection on my phone and over the LAN (WiFi) to wake my PC a few days ago.... but yesterday I decided to try waking it from a friends WiFi connection (used RDP to shut it down) but was unable to get it to wake back up.

At first I thought that my ISP had issued me a new IP (still have to setup a static IP… first things first), but I was able to connect to my VPN, run through the router, just fine. In the end, I was able to log into my routers front end via my cellphone, since I was using the VPN, and woke the computer up through the routers GUI... so it still worked in a round about way.

The odd thing is, however, that while connected to the VPN... I still wasn't able to get Splashtop to wake the computer. I even tried downloading an App specifically for this purpose (mocha WOL) to see if that would wake it up and it just wouldn't. It’s strange too because I've never had a problem with waking the machine from inside my network... and as far as the computer and everything else is concerned, when I'm connected to my VPN, wouldn't it see me inside the LAN? I even had an internal IP assigned to it (192.168.1.12)

The only possible thing that I could think of is that the routers firewall knew it was a VPN connection and wouldn't allow the WOL packet to get sent? It seems unlikely but I can't think of any other reason why it wouldn't work.
 
Let us take it one step back as we are getting a bit lost. We can worry about the VPN and security later:)
I've PM'd you with a website that will send a good legit WOL-packet over the WAN.

Configure your router with IP subnet directed broadcast. So forward port 9 to 192.168.1.255 as per your screenshots.

Verify:

1) That WOL is enabled in the BIOS (if WOL works on your LAN, it is OK)
2) WOL is enabled for the network adapter ((if WOL works on your LAN, it is also OK)
Steps to take:

1) boot your computer. Log in and then shut it down.
2) try to WOL from the WAN using the website I gave you. If it worked, great, shut the computer down again. If it did not, the following steps are pointless.
3) disconnect your router from the power supply for 30 seconds.
4) reconnect it, wait a few minutes until it is fully booted and then WOL from the WAN again using the website I gave you

ps: make sure you enter the correct public IP but I have the feeling you have enough knowledge to pull this off with a bit of help! I hope you have 2 computers or a laptop in your home. That really makes it a lot easier to test.
 
Thanks. I've had the morning to play around with it a bit and nothing I do seems to work. I'm using a 'magic packet' monitor on the client I want to wake and magic packet sender on my laptop to test the network. If I have it configured over LAN, then it works great. No problem at all receiving the packet.

If I have it setup for WOL over the internet (or per the page you sent me) it doesn't receive the packet. So I guess it's safe to assume that the router configuration that's the culprit.

Routers IP is 192.168.1.1
Subnet Mask is 255.255.255.0

Forwarding port 9 to 192.168.1.255

Under WOL settings, the correct machine & MAC addy are enabled and showing a NetBroadcast of 192.168.1.255 (which can't be changed)

I'm also sure that I'm inputting the correct external IP. Not sure what could be wrong especially since it worked once (unless I was connected to wifi on my phone and didnt realize it when I had tested it before)

I'd ask if something else needs to be setup via windows on the machine I want to wake, but not sure what that would be since the machine would be off anyway (No OS running).

I'm stumped.
 
Some stuff I can think of:

- Did you use the correct MAC format with "-" symbols between 2 subsequent hexadecimal numbers? For instance:
55-12-96-F4-6C-B4
- Did you put 255.255.255.255 as your Subnet Mask?

And pardon me, the website I linked has such a packet monitor too! It is very handy to test whether the WOL-packet makes it through your router. HIGHLY recommended tool to use.

The most likely cause though, is that DDWRT indeed does not allow subnet directed broadcasts. I'm booting up a host now to take a look at the router's config (I will post it later when I have gotten around accessing it). Your next best thing is using ARP-binding.

It is explained on this page: http://www.dd-wrt.com/wiki/index.php/WOL
refer to "2 - Add a static ARP entry by typing the following line into the Administration -> Commands section of the Web Interface and then saving with Save Startup. "

Although, they use all FF as a MAC, it will work just fine.

edit: darn, apparently I flashed it to Tomato to allow higher WAN throughput. Do you know how to apply the command?
 
Last edited:
Thanks Jeroen. I'm actually using the tools from that site lol (packer sniffer and sender)

So as far as the config goes... I tried following this guide verbatim (the part listed as "Remote Wake On LAN via Port Forwarding"). I added the proper arp entries as the guide calls out and even decided to use the same IP (.254... which isn't being assigned to a device on my network via DHCP) and still having problems. Perhaps I'm better off just using the VPN to connect to the router to wake various machines up on the network. Still, it would be nice to figure it out.

As for applying the command, I have it setup to run it on startup (so need to do a reboot after I change it)

EDIT:

For the MAC addy, I'm using the FF:FF:FF:FF:FF format. Should I be using dashes instead?
 
Last edited:
On the website try the dashes.

And did you update the port forward to point to .254 instead of .2? Do try a port higher than 1024. Some ISP's tend to block the ports lower than 1024

I don't mind to keep trying if you are up to it. I also would not mind trying to set it up for you although I can understand the aversion of having someone unknown accessing your router:))
 
Last edited:
Back
Top