There are many situations in which you may need to ping a large number of IP addresses. You can use the Tcl (usually pronounced “tickle”) shell built-in in both IOS and NX-OS to accomplish this task.

Simply replace the below IP addresses and VRF (where applicable) with your own, and copy/paste the script into your IOS or NX-OS based device.

IOS

tclsh
foreach address {

172.16.32.54
172.16.32.55
172.16.32.56
172.16.32.57
172.16.32.58
172.16.32.59

} {ping $address re 2
}

NX-OS

tclsh

foreach address {

172.16.32.54
172.16.32.55
172.16.32.56
172.16.32.57
172.16.32.58
172.16.32.59

} {cli ping $address vrf MY_VRF
}
Advertisements