Monday, May 29, 2017

TCL Script to ping subnet

foreach subnet {
1
41 } {
for {set i 1} {$i < 255} {incr i} {
ping 192.168.$subnet.$i re 2 ti 0
}
}


001d.46c2.70c0

tcl script for WakeonLAN - IOS 15

home# tclsh
home(tclsh)#

proc WakeOnLan {broadcastAddr 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 $broadcastAddr 4580] \
          -broadcast 1
     puts $udpSock $pkt
     flush $udpSock;
     close $udpSock
}

home(tclsh)# WakeOnLan 255.255.255.255 000f13cd80a1

 00:11:32:39:87:25

00:11:32:38:E8:EF