The East Coast suffered Hurricane Sandy today. With the lights flickering off for brief moments every half hour or so, I decided it was time to stop hastily typing “ping” commands to diagnose my connectivity problems and so I wrote something to do it better. The result is a script that intelligently tests your networking hardware for connectivity.
It does 3 things:
- Ping the local gateway to make sure the hardware is working
- Ping the ISP to make sure that link is working
- Ping an Internet address to make sure that connectivity exists
Blasting ICMP packets at the Internet as fast as you can is not considerate. You want to ping your gateway quickly so that you know immediately when it comes up. Once you have internet connectivity though, you can ping more slowly.