cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5691
Views
15
Helpful
5
Replies

Wake on Lan

Hello

 

Is is possible to wake up a pc with wake on lan with a cisco router?  So the router initilize a packet to a MAc Address and wake up the PC.

 

I found that ping can do that but how? Extended ping but when i enter no Target IP the router cancel.

 

Test-Spoke1#ping
Protocol [ip]:
Target IP address:
% Bad IP address
Test-Spoke1#

 

Thanks

 

5 Replies 5

You need to put a IP address in extended ping.

Example

Router A>enable
Router A#ping
Protocol [ip]:
Target IP address: 192.168.40.1

Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 172.16.23.2

!---Ping packets are sourced from this address.

Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 162.108.21.8, timeout is 2 seconds:
!!!!!

 

I have not seen anyone use packets generated by a router to do Wake On LAN so can not offer advice about that. But it is certainly true that ping depends on having a destination IP address. So ping or extended ping with specifying no destination address will certainly not work.

 

If the PC had a fixed IP address perhaps you could ping to that IP. But that depends on there being an entry in the ARP table for that IP and I am not certain whether you could count on that. Would it perhaps work if you did a ping to the subnet broadcast address?

 

HTH

 

Rick

HTH

Rick

I found a solution. The trick is to take tclsh and load a script. This script is

 

proc WakeOnLan { macAddr } {
     set net [binary format H* [join [split $macAddr -:] ""]]
     set pkt [binary format c* {0xff 0xff 0xff 0xff 0xff 0xff}]

     for {set i 0} {$i < 16} {incr i} {
        append pkt $net
     }

     # Open UDP and Send the Magic Paket.
     set udpSock [udp_open]
     fconfigure $udpSock -translation binary \
          -remote [list 255.255.255.255 4580] \
          -broadcast 1
     puts $udpSock $pkt
     flush $udpSock;
     close $udpSock
}

if { $::argc > 0 } {
    set i 1
    foreach arg $::argv {
    WakeOnLan $arg
    incr i
    }
}

 

Then you can make an event and send the packet with the MAC address

action 1.1 cli command "tclsh flash:Wakeonlan.tcl ecb1d75f42d6"

Excellent... thanks

By using Kron command in Cisco, you will able to run some commands on schedule. For example, you can run ping command on specific time, but still you need to have target IP addresses.