DD-WRT WakeOnLAN

Introduction

WOL provides the ability to wake-up a sleeping, hibernating, or powered-off computer. Chances are your computer has the WOL feature.

Reasons to use WOL with DD-WRT:

  • You do not want a computer on all the time, yet you want to use it from outside your home or office, and there is a DD-WRT-enabled device as the Internet gateway for that computer, powered on all the time.
  • You run a server or computer all the time, and want it to shut down in case of over-temp or other situations. If this happens, you may still need to access documents on the server, from inside or outside the home network.

Preparation

You will need:

  1. A PC which supports WOL. Most modern PC‘s can be set-up this way.
  2. Administrative access to the computer you want to sleep/wake-up.
  3. The WOL computer should have a static IP address, one manually assigned or through static DHCP. In the example below, we assume your router LAN is 192.168.1.x (the default) and the static IP WOLcomputer is 192.168.1.254.
  4. Ideally, a second PC to test the WOL abilities of the first one. You can also use the DD-WRT device‘s Web Interface to send test packets, in place of a second PC.

Enable WOL on the Computer

  1. On the LAN adapter of the computer (physical ethernet adapter and/or wireless, given BIOS support), choose Properties/Configure.
  2. Power Management tab (far right). Check the second and third boxes to enable WOL. Press OK until you are back at Network Connections. Now the computer can normally be started from Hibernate, Standby, or PowerOff modes via a special management packet.
  3. Get ready to test your set-up by using a utility like WOL Magic Packet Senderhttp://magicpacket.free.fr/ (free). Install it on both the computer you are using and a second PC on the same physical LAN.
  4. On the WOL computer, open WOL Magic Packet and on the Receive tab, click the green Start button.
  5. On the second computer, open WOL Magic Packet and on the Send tab, put in:
    1. IP Address of WOL computer for Host Name
    2. 0.0.0.0 for Subnet Mask (select from drop-down)
    3. MAC address of LAN adapter on WOL computer. Use the command ‘ipconfig /all‘ if you don‘t know what this is.
  6. Click the green Send button. The WOL computer should respond with a pop-up box showing a packet was received.

Repeat the previous steps and go over the trouble-shooting tips until they work before proceeding.

Test that WOL works within the LAN

Hibernate, Standby, and Power-off the WOL computer, while clicking Send on the second computer, to test each mode to make sure WOL is working.

Once this step is working, you can go on to making WOL work when you are outside your LAN, such as at a cafe or another remote location.

Troubleshooting

Wake On LAN is usually disabled by default in most PCs. This feature, if optional, must be enabled in your BIOS otherwise WOL isn‘t going to work. Consult your motherboard‘s manual and BIOS screen (DEL at startup, usually). If you don‘t see the WakeOn-type options in your BIOS, usually somewhere in Power Management, your motherboard may not support WOL.

  • A good place to start is here: [1]

WOL Methods

WOL through Telnet/SSH

Note: This is the preferred method to send WOL magic packets remotely.

If you have local or remote Telnet/SSH access to your router, you can wake up a machine on the LAN by using the following command:

/usr/sbin/wol -i 192.168.1.255 -p PP AA:BB:CC:DD:EE:FF

Note that the full path to "/usr/sbin/wol" is important. Simply "wol" will not work.

Substitute AA:BB:CC:DD:EE:FF with the actual MAC address of the computer which you wish to boot remotely. Likewise, replace 192.168.1.255 with the actual broadcast address of the network (192.168.1.255 is the broadcast address when the machine has an IP of 192.168.1.x and subnet mask of 255.255.255.0). Replace "PP" with the port number your machine listens on (usually 7 or 9).

Remote Wake On LAN via Port Forwarding

To remotely wake up a computer over the Internet using Wake On LAN- follow these instructions:

1 - Create a port forward rule on the Web Interface (Applications & Gaming -> Port Range Forward) to the chosen ip:

wol  |  9  |  9  |  udp  |  192.168.1.254  |  x
  • Here, 9 is the default, but you can use any port number so long as your client wake-up application can talk to a port other than 9. Most WOL services will use either UDP port 7 or 9.
  • 192.168.1.254 is just an IP address in your LAN‘s subnet; it can be any IP, as long as it is not assigned to any device on your network.

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.

arp -i br0 -s 192.168.1.254 FF:FF:FF:FF:FF:FF
  • Do not change the FF:FF:FF:FF:FF:FF MAC address; this is a special MAC address used when broadcasting. WOL magic packets are constructed using the MAC address of the target computer, but should be and almost always are sent via broadcast; the MAC address used here controls with how the packet is sent, not how it is formed.
  • The 192.168.1.254 IP address should correspond with the IP address you used in the previous step. Again, this IP should be in your LAN‘s subnet, and you must not assign this IP address to any actual device on your network.
  • Explanation/rationale for this setup: Normally, WOL magic packets are sent to a special broadcast IP--to the final .255 in a subnet or to 255.255.255.255. Since port-forwarding to these special dedicated broadcast IPs does not work, what we need to do is create our own broadcast IP by taking an unused IP and assigning it a broadcast MAC and then port-forward to that.
  • As an optional alternative, instead of arp, you can use ip neigh (which does the exact same thing asarp). Support for ip neigh was removed from DD-WRT starting with build 17650, and arp is unavailable in DD-WRT builds older than 5672.
ip neigh change 192.168.1.254 lladdr ff:ff:ff:ff:ff:ff nud permanent dev br0ip neigh add 192.168.1.254 lladdr ff:ff:ff:ff:ff:ff nud permanent dev br0

3 - Reboot the router, or execute the startup commands manually.

  • To wake your computer from the internet using the DD-WRT device DynDNS name (or if you know it, the public IP of the router), try one of the following services;
  1. Mestrona‘s online WOL. You need to forward port 9 udp in step one, to use this service.
  2. Wake-On-LAN Online. It works both on ports 7 and 9 and allows WOL by a single URL of the form:http://mobile.wakeonlan.me/?ip=HOSTNAME&mac=MACADDRESS. It also allows for scheduled wakeup over the internet.
  3. To use the WOL Magic Packet application from a second PC:
    1. Host Name: DynDNS name of your DD-WRT device.
    2. Subnet Mask: 255.255.255.255
    3. MAC Address: WOL computer MAC address, not the DD-WRT MAC.
    4. Click the green Send button.

Automatic Wake-On-LAN Daemon

The Automatic WOL daemon will send out a periodic wake on lan packet at the intervals you specify. This may be useful to keep a system online most of the time even if it is turned off. (eg: A Media Center PC).

For Interval you can enter a value in seconds as low as 15 seconds and as high as 86400 seconds (1 day). Host name should be the broadcast address for your LAN. eg: 255.255.255.255 or 192.168.1.255. SecureON Password is computers that have a BIOS feature that secures the WOL function. If you do not have a BIOS that requires this form of password then you can leave the box blank or type in 00-00-00-00-00-00. MAC Address(es) should contain the MAC address of the networked machines you want a WOL to be sent to on your LAN.

The packets generated by the WOL daemon are sent to UDP port 40000. You likely will not need to worry about this unless the system you are attempting to send the WOL packet is on another subnet or you are trying to monitor the packets.

note: the UI says that the Interval accepts a range of 1-86400 seconds but it will only send out a WOL packet at a minimum of 15 second intervals. All values below 15 are accepted but the interval will still be every 15 seconds.

A useful tool for watching the WOL packets on a Windows computer is available at www.depicus.com/wake-on-lan (use port 40000 when monitoring) Or you can use a more generic protocol analyzer tool like Wireshark.

时间: 2024-08-12 18:58:09

DD-WRT WakeOnLAN的相关文章

dd wrt

0 1 * * * root /sbin/ifconfig ath0 down 30 7 * * 1-5 root /sbin/ifconfig ath0 up 30 8 * * 1-5 root /sbin/ifconfig ath0 down 0 21 * * 1-5 root /sbin/ifconfig ath0 up 0 10 * * 0,6 root /sbin/ifconfig ath0 up ifconfig ath0 down iwconfig ath0 txpower off

经验谈系列 我们应该怎么给父母配电脑

经验谈系列 我们应该怎么给父母配电脑. 以下只是记录笔者这半年外地大学的一个插曲 作为一个IT宅,不可避免的要面对一个人生大事--上大学 在这期间可能我们的父母并不如我们一般喜欢电脑.QAQ 而在干干净净上大学之前我们需要干一件漂亮事情就是给父母留一台电脑. 首先需要明白需求 目前的时代可能我们用的最多的是手机而不是电脑 不管是android还是iphone 可能我们的父母更需要的是方便快捷的 手机 而不是电脑 而笔者的需求是母上需要每周用excel提交每周的计划.此外需要上q. 而父上的需求是

开源无线路由器知识简介

由于做项目的需要和自己的爱好,最近在找关于无线路由器的资料,找到了些相关的资料,在这里总结一下.一.无线路由器与无线AP的区别AP为Access Point简称,一般翻译为"访问节点",无线AP主要是提供无线工作站对有线局域网和从有线局域网对无线工作站的访问,在访问接入点覆盖范围内的无线工作站可以通过它进行相互通信.通俗的讲,无线AP是无线网和有线网之间沟通的桥梁.当前的无线AP可以分为两类:单纯型AP和扩展型AP. 单纯型AP的功能相对比较简单,缺少路由功能,只能当无线集线器.它相当

dd 使用说明

使用dd来测试硬盘读写速度 dd只能提供一个大概的测试结果,而且是连续IO 而不是随机IO ,理论上文件规模越大,测试结果越准确. 读性能测试 # time dd  iflag=direct,nonblock  if=/dev/sda2 of=/dev/null bs=8k count=8388608 因为/dev/sda2是一个物理分区,对它的读取会产生IO,/dev/null是伪设备,相当于黑洞,of到该设备不会产生IO,所以,这个命令的IO只发生在/dev/sdb1上,也相当于测试磁盘的读

自定义laravel函数dd()

dd()是laravel中一个帮助调试脚本的函数,可以打印php中所有类型的变量.它让变量显示的方式变得更加优雅,这也正是laravel框架的一大优点.首先看看dd()的源码,本文中laravel框架版本为5.1,(对应文件在laravel框架中的目录路径laravel/vendor/laravel/framework/src/Illuminate/Support/helpers.php) 1 function dd() 2 { 3 array_map(function ($x) { 4 (ne

多命令顺序执行,dd命令,管道|,grep,通配符

多命令顺序执行:命令1;命令2 命令之间没有逻辑关系 命令1&&命令2 命令1执行正确才执行命令2,命令1执行错误不会执行命令2 命令1||命令2 命令执行错误才执行命令2,命令1执行正确不会执行命令2 命令 && echo yes || echo no dd if=输入文件 of=输出文件 bs=字节数 count=个数 if=输入文件 指定源文件或源设备 of=输出文件 指定目标文件或目标设备 bs=字节数 指定一次输入/输出多少字节,即把这些字节看做一个数据块 cou

mac os x 下查看dd命令刻录U盘的进度

dd命令在Linux操作系统上运行,我们使用"killall -USR1 dd"命令即显示当前dd命令刻录的进度,但在OS X上面执行此命令,可能会导致dd进程中止: 维基百科对dd命令的介绍说:"向运行中的dd进程发送SIGINFO信号(Linux上为USR1)可以使它将I/O统计信息打印到标准错误一次,然后继续复制(注意在OS X上,信号可能导致进程终止)." 重点是SIGINFP信号,Linux上为使用"killall -USR1 dd"向

swap与dd命令使用详解

处理交换文件和分区 交换分区是系统RAM 的补充 基本设置包括: 创建交换分区或者文件 使用mkswap 写入特殊签名 在/etc/fstab 文件中添加适当的条目 使用swapon -a 挂载交换分区 启用:swapon swapon [OPTION]... [DEVICE] -a :激活所有的交换分区: -p PRIORITY :指定优先级 /etc/fstab:pri=value 禁用:swapoff [OPTION]... [DEVICE] [[email protected] ~]#

将yyyyMMdd,dd/MM/yyyy 类型字符串转换为datetime 类型 yyyy-MM-dd C#

DateTime ConvertDate = DateTime.ParseExact("20140504", "yyyyMMdd", null, System.Globalization.DateTimeStyles.AllowWhiteSpaces).ToString("yyyy-MM-dd"); DateTime.ParseExact("18/05/2014", "dd/MM/yyyy", System