what we want to obtain is:
IF a client connect to openVPN server on the router (AC68U)
THEN the router automatically send a WOL (wake on lan) command to a PC
In this guide I assume you have the JFFS partition already active and writable and that you already configured WOL to work inside your LAN.
So SSH to your router and give this command:
now hit i and paste this (CHANGE THE DATA FOR YOUR CONFIGURATION and delete " "):
press "ESC" then ":wq"
change permission of the file just created:
Next thing we have to add a perm arp entry linked to the pc to wake up
now hit i and paste this (CHANGE THE DATA FOR YOUR CONFIGURATION and delete " "):
press "ESC" then ":wq"
change permission of the file just created:
Now go to your router web interface. Go to "Advanced Settings/VPN/VPN Server" and disable OpenVPN Server.
Go to "Advanced Settings/VPN/VPN Details" and in "Custom configuration" add these two lines:
Now enable the OpenVPN Server and reboot the router.
Time to test: put the pc you want to wakeup in standby and use another device to connect to OpenVPN Server. If all is working the pc have to wake up from standby (or from power off if your Pc support it)
IF a client connect to openVPN server on the router (AC68U)
THEN the router automatically send a WOL (wake on lan) command to a PC
In this guide I assume you have the JFFS partition already active and writable and that you already configured WOL to work inside your LAN.
So SSH to your router and give this command:
Code:
vi /jffs/scripts/wakeonvpn.sh
now hit i and paste this (CHANGE THE DATA FOR YOUR CONFIGURATION and delete " "):
Code:
#!/bin/sh
logger -t "($(basename $0))" $$ "Wake On VPN"
/usr/bin/ether-wake -i br0 "MAC ADDRESS OF THE PC YOU WANT TO WAKE UP"
exit 0
press "ESC" then ":wq"
change permission of the file just created:
Code:
chmod 777 /jffs/scripts/wakeonvpn.sh
Next thing we have to add a perm arp entry linked to the pc to wake up
Code:
vi /jffs/scripts/services-start
now hit i and paste this (CHANGE THE DATA FOR YOUR CONFIGURATION and delete " "):
Code:
#!/bin/sh
arp -i br0 -s "IP ADDRESS OF THE PC YOU WANT TO WAKE UP" "MAC ADDRESS OF THE PC YOU WANT TO WAKE UP"
press "ESC" then ":wq"
change permission of the file just created:
Code:
chmod 777 /jffs/scripts/services-start
Now go to your router web interface. Go to "Advanced Settings/VPN/VPN Server" and disable OpenVPN Server.
Go to "Advanced Settings/VPN/VPN Details" and in "Custom configuration" add these two lines:
Code:
script-security 2
client-connect /jffs/scripts/wakeonvpn.sh
Now enable the OpenVPN Server and reboot the router.
Time to test: put the pc you want to wakeup in standby and use another device to connect to OpenVPN Server. If all is working the pc have to wake up from standby (or from power off if your Pc support it)