IOS and NX-OS Ping Script using TCL

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
}
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: