The simplest test of network connectivity is called ping. A ping message is merely a way for one machine to ask another machine, “Are you alive.” If I want to test the connectivity of my machine to the internet, I will find a machine across the network and ‘ping’ it. While ping will execute if given a domain name (such as adam.younglogic.com) that actually requires a decent bit of protocol magic to translate from that to the associated IPv4 address. Usually, I will use the machine responsible for telling my machine about domain names. These are called name servers. In a Linux system, the name servers are defined by the file /etc/resolv.conf. Someone had something against the letter ‘e’. Thus cat /etc/resolv.conf will get you at least one ipaddress to ping. However, a simpler test is to talk to your default router. This is the place where your workstation/laptop sends all outgoing network traffic.
On my system I can find out this info my typing route -n:
adyoung@adyoung-laptop:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.171.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
172.16.127.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
10.17.124.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 10.17.127.253 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 0.0.0.0 0.0.0.0 U 1000 0 0 eth1
With the interesting line being:
0.0.0.0 10.17.127.253 0.0.0.0 UG 0 0 0 eth0
This says that anything which matches the mask 0.0.0.0, which is everything, route to 10.17.127.253. So this is where I would start:
$ ping 10.17.127.253
PING 10.17.127.253 (10.17.127.253) 56(84) bytes of data.
64 bytes from 10.17.127.253: icmp_seq=1 ttl=64 time=0.663 ms
64 bytes from 10.17.127.253: icmp_seq=2 ttl=64 time=0.574 ms
64 bytes from 10.17.127.253: icmp_seq=3 ttl=64 time=0.614 ms
— 10.17.127.253 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.574/0.617/0.663/0.036 ms
Note that I hit<ctlr-c> to break it after three responses. Most Linux people that have set up their own networks have to do this type of troubleshooting/testing on a regular basis.
What is the comparable test for IPv6? Well, articles found via a goolge search talk about running ping ipv6, but if I do that I get:
$ ping ipv6
ping: unknown host ipv6
Which tells me the ping program doesn’t know about ipv6 as is. Here is what I eventually found that worked:
ping6 -I eth0 ::1
The ping6 binary seems to be ipv6 aware, where as ping itself is not. I have to tell it explicitly to use a given network interface (ethernet card or port on the motherboard), in this case, eth0.
::1 is the loopback address for networking.
$ /sbin/ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1106638 errors:0 dropped:0 overruns:0 frame:0
TX packets:1106638 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:220029171 (209.8 MiB) TX bytes:220029171 (209.8 MiB)