'''2006-02-06''' [SRIV] I've always wondered how to utilize the Wake On Lan feature of modern computers, especially since last night when I had to halt a machine 200 miles away and I had no one there to power it back up. After you enable WOL in you motherboard's [BIOS], boot into your OS. I typically use [Linux]. In order for the halt command to power down the computer you must have the apm module loaded first. Now, issue the halt command, and the computer should turn off, but, the [LAN] jack indicator [LED]s should still be lit. Run this script, passing the IP Address and [MAC] address of the computer's [NIC] on the command line: wakeonlan.tcl 192.168.0.55 00:40:63:D5:2A:B9 and you will note that the computer will power on. You'll need to obtain the [tcludp] extension as well. # wakeonlan.tcl - Steve Redler IV # # Create and send the magic packet needed to wake a halted # computer over the internet via broadcast UDP socket. # package require udp 1.0.8 # Select the ipaddress and the port number. set ipaddress [lindex $argv 0] set port 32767 # Create a broadcast sending udp socket. set s [udp_open $port] fconfigure $s -buffering none -blocking 0 fconfigure $s -broadcast 1 -remote [list $ipaddress $port] # Generate and send the magic packet set hw_addr [binary format H* [string map {: ""} [lindex $argv 1]]] set msg "\xff\xff\xff\xff\xff\xff[string repeat $hw_addr 16]" # Lets send it 4 times to be safe for {set a 0} {$a < 4} {incr a} { puts -nonewline $s $msg after 100 } exit ---- '''2006-02-08''' You'd better send this to the subnet broadcast IP address 192.168.0.255 - JR [SRIV] Indeed, if you are sending the packet to a machine on your local lan segment, you should send it to the broadcast address. When you are sending it over the internet, then you will send the packet to the remote router/firewall, which needs to forward the packet to the broadcast address on the private network side. I've read that this is tricky when using a iptables based firewall/router. On my Belkin router at home, I was able to forward incomming port 32767 to 192.168.0.255 on the prive net side, and all worked well. ---- [Category Networking]