Testing Network Connectivity with ping


Testing Network Connectivity with ping

After you've finished your network configurations, setting them either in Sysinstall or with /etc/netstart, you can use ping to make sure the settings are correct. The ping program is a simple ICMP-based tool that checks for echoes from a specified host and reports the roundtrip time it takes each packet to get to the host and back.

The use of ping is pretty simple. You can run it against either an IP address or a hostname (or /etc/hosts alias), and it will run until you interrupt it with Ctrl+C:

# ping fred PING fred (114.235.123.11): 56 data bytes 64 bytes from 114.235.123.11: icmp_seq=0 ttl=243 time=485.344 ms 64 bytes from 114.235.123.11: icmp_seq=1 ttl=243 time=351.589 ms ^C --- fred ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 351.589/418.466/485.344/66.877 ms


This is a healthy TCP/IP configuration because the specified host replied to the ping. However, if the host isn't reachable, the ICMP packets will time out and report the failure to connect. If this happens, something's wrong with your configuration (alternatively, the remote host might actually be down, so make sure to try multiple target hosts). The following shows a ping attempt that fails to reach its target:

# ping 64.41.131.133 PING 64.41.131.133 (64.41.131.133): 56 data bytes ping: sendto: Host is down ping: sendto: Host is down ping: sendto: Host is down ping: sendto: Host is down ^C --- 64.41.131.133 ping statistics --- 10 packets transmitted, 0 packets received, 100% packet loss


Other reasons ping might fail include a firewall that's configured to block ICMP (a common configuration on publicly accessible networks, due to security concerns), or a router that's overloaded (ICMP packets are discarded readily by routers under load, because they're non-essential traffic). If you can't reach a host, it's a good idea to try connecting with Telnet to a port on the host that's known to be open, such as telnet 64.41.131.133 25 to reach the SMTP port.




FreeBSD 6 Unleashed
FreeBSD 6 Unleashed
ISBN: 0672328755
EAN: 2147483647
Year: 2006
Pages: 355
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net