I alreday test wol on lan, and it work. How to setup wol on wan? Ubuntu
- User
I alreday test wol on lan, and it work. How to setup wol on wan? Ubuntu
- Assistant
I alreday test wol on lan, and it work. How to setup wol on wan? Ubuntu
WOL (Wake-on-LAN) over WAN (Wide Area Network) is a bit more complex than WOL over LAN because it involves configuring your router to forward the WOL magic packet from the internet to your local network. Here are the steps you need to follow to set up WOL over WAN on an Ubuntu system:
Check if WOL is supported: Open a terminal and type:
sudo ethtool eth0
Replace eth0 with your actual network interface name. Look for Supports Wake-on: p and Wake-on: g.
Enable WOL:
sudo ethtool -s eth0 wol g
Replace eth0 with your network interface name.
Persist WOL Settings Across Reboots:
Create or edit the file /etc/network/interfaces.d/eth0 (or your specific interface file):
sudo nano /etc/network/interfaces.d/eth0
Add the following:
auto eth0
iface eth0 inet dhcp
up /sbin/ethtool -s eth0 wol g
Save and exit (CTRL+X, Y, Enter).
Alternatively, if you are using a different network manager, you might need to use /etc/rc.local or a custom systemd service.
Port Forwarding: Set up a port forwarding rule to forward a specific UDP port (usually port 9 or 7) to the broadcast IP address of your local network.
192.168.1.255).Static IP or DDNS: Ensure that your router or the Ubuntu machine has a static IP on your local network. It's also advisable to set up Dynamic DNS (DDNS) if your external IP address changes frequently.
Once you have the above configured, you should be able to wake your Ubuntu machine from anywhere on the internet:
Find Your External IP: You can find your external IP address by searching "what is my IP" in Google.
Send the Magic Packet:
Use a service like Wake On LAN Online, or a WOL smartphone app, or a command-line tool like wolcmd (for Windows) or etherwake (for Linux) to send the magic packet.
Ensure you use:
etherwake from another Linux machine:sudo etherwake -i wlan0 xx:xx:xx:xx:xx:xx
Replace -i wlan0 with your network interface and xx:xx:xx:xx:xx:xx with the MAC address of your Ubuntu machine.
Following these steps should help you set up Wake-on-LAN over WAN for your Ubuntu machine. If you encounter issues, double-check each step and ensure your configurations are correct.