IPv6

From MediaWiki
Revision as of 19:08, 4 February 2014 by Paul Blankenbaker (talk | contribs) (→‎Ping a IPv6 Address)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Resources

Internet Protocol version 6 (IPv6) resources:

IPv6 - Wikipedia
Information about IPv6 maintained at the Wikipedia web site.

Usage Notes

Determine IPv6 Address

Use the ifconfig command to show the IPv6 address associated with a particular interface (look for the line labeled: "inet6 addr:").

Using ifconfig to Find the inet6 addr
[root@taco ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:C9:D5:1A  
          inet addr:192.168.0.138  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fec9:d51a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1293164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1878939 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:151619640 (144.5 MiB)  TX bytes:642030150 (612.2 MiB)
          Interrupt:17 Base address:0x1400 

[root@taco ~]#

In the above example, the IPv6 address is: "fe80::20c:29ff:fec9:d51a". The double colons (::) in the address represent 3 groupings of zeros. Hence, "fe80::20c:29ff:fec9:d51a" is the short hand equivalent of: "fe80:0:0:0:20c:29ff:fec9:d51a".

Ping an IPv6 Address (scope link)

The following demonstrates how one can ping a IPv6 address that has a limited link scope:

Using ping6 to ping a IPv6 Address
[root@taco ~]# ping6 -I eth0 -c 3 fe80::20c:29ff:fec9:d51a
PING fe80::20c:29ff:fec9:d51a(fe80::20c:29ff:fec9:d51a) from fe80::20c:29ff:fec9:d51a eth0: 56 data bytes
64 bytes from fe80::20c:29ff:fec9:d51a: icmp_seq=1 ttl=64 time=0.361 ms
64 bytes from fe80::20c:29ff:fec9:d51a: icmp_seq=2 ttl=64 time=0.935 ms
64 bytes from fe80::20c:29ff:fec9:d51a: icmp_seq=3 ttl=64 time=0.349 ms

--- fe80::20c:29ff:fec9:d51a ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.349/0.548/0.935/0.274 ms
[root@taco ~]#

Ping an IPv6 Address (scope global)

When a IPv6 address is global in scope, it indicates that you will not need to specify the NIC when running commands. The following demonstrates how one can ping a IPv6 address that has a global scope:

Using ping6 to ping a IPv6 Address
[root@taco ~]# ping6 -c 3 2001:db8:1:0:a00:27ff:feec:97c5
PING 2001:db8:1:0:a00:27ff:feec:97c5(2001:db8:1:0:a00:27ff:feec:97c5) 56 data bytes
64 bytes from 2001:db8:1:0:a00:27ff:feec:97c5: icmp_seq=1 ttl=64 time=4.12 ms
64 bytes from 2001:db8:1:0:a00:27ff:feec:97c5: icmp_seq=2 ttl=64 time=205 ms
64 bytes from 2001:db8:1:0:a00:27ff:feec:97c5: icmp_seq=3 ttl=64 time=1.73 ms

--- 2001:db8:1:0:a00:27ff:feec:97c5 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 1.731/70.369/205.254/95.383 ms
[root@taco ~]#

Router Advertisement Daemon for IPv6 (radvd)

If you are on a network that has not been set up for IPv6 support, it is likely that you will only find IPv6 addresses which are limited in scope to: link.

Listing IPv6 Address Before radvd
[root@taco ~]# ip -6 addr show p2p1
2: p2p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 fe80::a00:27ff:feec:97c5/64 scope link 
       valid_lft forever preferred_lft forever
[root@taco ~]#

It is difficult to work with IPv6 addresses with a scope of: link. To use these addresses you will need to specify the NIC along with the IPv6 address when running commands (and not all commands support the option of specifying a interface).

One easy method to assign global dynamic IPv6 addresses to the machines on your network is to start the radvd service on your NST system:

Starting radvd Service
[root@taco ~]# systemctl start radvd
[root@taco ~]#

Once the radvd service has been started, all machines on the LAN will likely be assigned one or more dynamic IPv6 addresses global in scope.

Listing IPv6 Address After radvd
[root@taco ~]# ip -6 addr show p2p1
2: p2p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2002:c0a8:12c:1234:a00:27ff:feec:97c5/128 scope global dynamic 
       valid_lft 292sec preferred_lft 292sec
    inet6 2001:db8:1:0:a00:27ff:feec:97c5/128 scope global dynamic 
       valid_lft 86392sec preferred_lft 86392sec
    inet6 fe80::a00:27ff:feec:97c5/64 scope link 
       valid_lft forever preferred_lft forever
[root@taco ~]#