Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
TCLSH and Macro Ping Test on Cisco Routers and Switches
1. TCLSH and Macro Ping Test on
Cisco Routers and Switches
www.netprotocolxpert.in
2. • When you are studying for CCIE, you will have to check connectivity
every time. It’s a good idea to use ping to check if you can reach all IP
addresses of the routers and switches in your network. If you have
many devices and many IP addresses it will take too much time to
ping each IP address manually.
• You can use TCLSH (Tool Control Language) on your Cisco routers and
devices, a scripting language that is used a lot by Cisco and one of the
things it can do is ping IP addresses.
3. • First you should check the active IP addresses on your device using the
following command:
• Router#show ip alias
• Address Type IP Address Port
• Interface 192.168.12.1
• Interface 192.168.13.1
• Interface 192.168.1.1
• The show ip alias command will show you all active IP addresses on your
device.
4. • You can also use show ip interface brief | exclude unassigned to see all IP
addresses of active interfaces:
• Router#show ip interface brief | exclude unassigned
• Interface IP‐Address OK? Method Status
• Protocol
• FastEthernet0/0 192.168.12.1 YES manual up
• up
• Serial0/0.1 192.168.13.1 YES manual up
• up
• Loopback0 192.168.1.1 YES manual up
• up
5. • Now we can use TCLSH to automatically ping all these IP addresses, this is how it works:
• Router#tclsh
• Router(tcl)#foreach address {
• +>1.1.1.1
• +>2.2.2.2
• +>3.3.3.3
• +>150.1.4.4
• +>} { ping $address repeat 3 size 1500 }
• Type escape sequence to abort.
• Sending 3, 1500‐byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
• !!!
6. • Success rate is 100 percent (3/3), round‐trip min/avg/max =
4/8/12 ms
• Type escape sequence to abort.
• Sending 3, 1500‐byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
• !!!
• Success rate is 100 percent (3/3), round‐trip min/avg/max =
4/4/4 ms
• Type escape sequence to abort.
• Sending 3, 1500‐byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
• !!!
7. • Success rate is 100 percent (3/3), round‐trip min/avg/max = 1/1/1 ms
• Type escape sequence to abort.
• Sending 3, 1500‐byte ICMP Echos to 150.1.4.4, timeout is 2 seconds:
• !!!
• Success rate is 100 percent (3/3), round‐trip min/avg/max = 1/4/8 ms
• Router(tcl)#tclquit
• The script above will ping all IP addresses 3 times and set the packet size
to 1500 bytes. Something you should remember is that you need to type
tclquit to exit TCLSH scripting.
8. • We can use TCLSH on routers and most switches. In case our switch doesn’t
support TCLSH WE can also create a macro that does a similar job. Here’s how
to do it:
• Switch#configure terminal
• Switch(config)#macro name PING_TEST
• Enter macro commands one per line. End with the character '@'.
• do ping 192.168.12.1
• do ping 192.168.13.1
• do ping 192.168.1.1
• @
9. • First we will create a macro called PING_TEST. A macro can only be applied
from the global configuration so we need to add “do” in front of our ping.
The macro is stored in the running configuration as you can see here:
• Switch#show run | begin macro
• macro name PING_TEST
• do ping 192.168.12.1
• do ping 192.168.13.1
• do ping 192.168.1.1
• @
10. • Now we will test our macro:
• Switch(config)#macro global apply PING_TEST
• Type escape sequence to abort.
• Sending 5, 100‐byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
• !!!!!
• Success rate is 100 percent (5/5), round‐trip min/avg/max = 1/1/4 ms
• Type escape sequence to abort.
• Sending 5, 100‐byte ICMP Echos to 192.168.13.1, timeout is 2 seconds:
• !!!!!
11. • Success rate is 100 percent (5/5), round‐trip min/avg/max = 1/1/1 ms
• Type escape sequence to abort.
• Sending 5, 100‐byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
• !!!!!
• Success rate is 100 percent (5/5), round‐trip min/avg/max = 1/1/4 ms
• Switch(config)#
• From the global configuration just type macro global apply and the name of your
macro. As we can see it pings all our IP addresses.