10-09-2015 06:17 AM - edited 03-05-2019 02:30 AM
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
10-09-2015 07:08 AM
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:
!!!!!
10-09-2015 08:41 AM
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
10-13-2015 02:30 AM
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"
07-22-2022 05:55 AM
Excellent... thanks
10-09-2015 09:09 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide