My ping command (on Debian 6 or 7) will repeatedly attempt to ping a server even while the network is down, if the network was up when it was started. Is there some way to start ping while the network is down and get this same behavior?
Here's an example. If I start a repeating ping while the network is up, and while the ping is running, the network goes down, the ping continues to repeat. If the network comes back up, it will continue pinging:
me@here:~$ ping -n 220.127.116.11 PING 18.104.22.168 (22.214.171.124) 56(84) bytes of data. 64 bytes from 126.96.36.199: icmp_req=1 ttl=46 time=117 ms ... 64 bytes from 188.8.131.52: icmp_req=6 ttl=46 time=116 ms ping: sendmsg: Network is unreachable ... ping: sendmsg: Network is unreachable 64 bytes from 184.108.40.206: icmp_req=108 ttl=46 time=694 ms ...
However, if the network is down when I run ping:
me@here:~$ ping -n 220.127.116.11 connect: Network is unreachable me@here:~$
This is the same unreachable network problem, but ping doesn't keep trying until the network is up again, like it had before.