I am no expert, especially in Linux, but I just did this to enable WOL from the internet on my WNDR3700.
First you have to SSH into the router (I use putty).
cd to /etc/init.d
use Vi (text editor) to edit a file called "done". Add your commands into this file. I understand that commands in this file are executed at the end of the boot up. It worked great for me.
Here is a link for the Vi commands that was helpful:
while :
do
ping -c 5 8.8.8.8 >/dev/null # ping 5 packets
sleep 2 # wait 2 seconds
done
I add it to done script but when i reboot router sys led keep blinking and internet conenction isn't available from connected client.
So i decide to write down an entirely new script that i put in init.d: