CCIE Tip – Super Easy Ping Script
Welcome to Network Engineer Pro. I’m Rafael, CCIE 64356.
#shorts
I’m working on ton of content (videos, labs and more) to help you learn networking. If you want to stay up to date on what I’m working on and be the first to know then head to my website where you can sign up and get notified:
➤ https://www.networkengineerpro.com/
You can also follow me on Facebook:
➤ https://www.facebook.com/NetworkEngineerPro
————————————————————————————————————–
When I was preparing for my CCIE lab back in 2018/2019 as a way to verify IP reachability in my topologies and labs I was using ping. From the router I’ll type « ping 1.1.1.1 » for example. But when it comes to the CCIE lab, time is not your friend. There are tons of devices and various IP’s that need to be reachable. Do you really want to manually ping various IP’s from various devices ? No way that takes too much time, like 40 minutes just pinging various addresses. I’d rather save that 40 minutes towards the end fixing a technology I broke, or verifying that I didn’t break and rules or restrictions during my verification phase towards the end.
At some point I learned about TCL scripting. TCL stands for the « tool command language ». Its an entire scripting language. I am not a TCL scripting expert by any means but I did learn a technique to save precious time using it.
During the lab exam, I would go to all of my routers and switches and gather all of the IP’s and put them in notepad. I wanted to make sure I kept track of what was reachable and what wasn’t. The goal is 100 percent IP reachability at the end. Once you have the IP’s, add the TCL script in there. It looks like this.
tclsh
foreach address {
1.1.1.1
2.2.2.2
3.3.3.3
10.10.10.1
11.11.11.11
10.10.10.2
10.10.10.10
20.20.20.20
22.22.22.22
30.30.30.30} { ping $address
}
You can specify a source interface like loopback 0 like this:
tclsh
foreach address {
1.1.1.1
2.2.2.2
3.3.3.3
10.10.10.1
11.11.11.11
10.10.10.2
10.10.10.10
20.20.20.20
22.22.22.22
30.30.30.30} { ping $address source lo0
}
Or even a repeat count:
tclsh
foreach address {
1.1.1.1
2.2.2.2
3.3.3.3
10.10.10.1
11.11.11.11
10.10.10.2
10.10.10.10
20.20.20.20
22.22.22.22
30.30.30.30} { ping $address source lo0 re 2
}
Don’t use a repeat count of less than 2 because if there is no ARP entry on the device it may need to ARP for one, which results in the first ping being lost. You will be chasing down a ghost, thinking something is broken when its not. Honestly the time difference between the default count of 5 and 2 is nothing so its not even a big deal to change but I demonstrated it so you can see some options. Practice the syntax a few times and you will have it memorized. I hope this helps you in your lab studies. It saved me tons of time and I know it will do the same for you.
#ccna #ccnp #ccie
Views : 1083
network engineer
Source by Network Engineer Pro