Configure IPv6 addresses and perform some basic IPv6 troubleshooting.
IPv6 in Brief
IPv6 Address Format
The IPv6 address is noted as 8 groups of 16 bits (which equals 4 hexadecimal numbers), for example:
There are a couple of formatting rules: leading zeroes do not have to be written, and long strings of all zeroes can be summarised as ::. This would make the previous example look like:
Common IPv6 Addresses
The localhost address is ::1/128, which is 127.0.0.1/8 in IPv4 format.
All addresses would be ::, what is 0.0.0.0 in IPv4 format.
Multicast address is ff00::/8.
Unique Local Addresses
A unique local address is an IPv6 address in the block fc00::/7. Unique local addresses are not routable in the global IPv6 Internet.
A comparison to IPv4 would be 10.0.0.0/8 or 192.168.0.0/16 networks.
The link-local address is automatically configured on each IPv6 interface, but does not allow for globally unique addressing.
To conform to standard /64 addressing on subnets, the actual link-local addresses are assigned with the prefix fe80::/64.
IPv6 requires a link-local address on every network interface on which the IPv6 protocol is enabled, even when routable addresses are also assigned.
Add IPv6 Address to an Existing Interface
# nmcli c NAME UUID TYPE DEVICE slave2 684ab2dc-6b40-4a50-b2b4-0450f65c4cef 802-3-ethernet enp0s8 slave1 00a5d6e6-5360-414e-8997-025fdec6d09e 802-3-ethernet enp0s17 mybond0 d021371e-5e22-4b1a-a4eb-0b96bde80702 bond mybond0
We want to add an IPv6 address fc00::10:8:8:71 to the mybond0 interface:
# nmcli c mod mybond0 ipv6.addresses fc00::10:8:8:71/7 ipv6.method manual
# nmcli c down mybond0; nmcli c up slave1; nmcli c up slave2
# ip ad show mybond0 7: mybond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP link/ether 08:00:27:ff:71:00 brd ff:ff:ff:ff:ff:ff inet 10.8.8.71/24 brd 10.8.8.255 scope global mybond0 valid_lft forever preferred_lft forever inet6 fc00::10:8:8:71/7 scope global valid_lft forever preferred_lft forever inet6 fe80::a00:27ff:feff:7100/64 scope link valid_lft forever preferred_lft forever
We see that the link-local address (scope link) is created automatically based on the network prefix fe80::/64, followed by the MAC address 08:00:27:ff:71:00 of the network card, where fffe is inserted in the middle of the MAC address part.
The unique local address (scope global) is the one that we just set up, fc00::10:8:8:71/7. We should be able to ping6 it.
# ping6 -c2 fc00::10:8:8:71 PING fc00::10:8:8:71(fc00::10:8:8:71) 56 data bytes 64 bytes from fc00::10:8:8:71: icmp_seq=1 ttl=64 time=0.037 ms 64 bytes from fc00::10:8:8:71: icmp_seq=2 ttl=64 time=0.054 ms --- fc00::10:8:8:71 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.037/0.045/0.054/0.010 ms
The link-local addresses that can be reached through interface mybond0:
# ping6 -c2 fe80::a00:27ff:feff:7100%mybond0 PING fe80::a00:27ff:feff:7100%mybond0(fe80::a00:27ff:feff:7100) 56 data bytes 64 bytes from fe80::a00:27ff:feff:7100: icmp_seq=1 ttl=64 time=0.039 ms 64 bytes from fe80::a00:27ff:feff:7100: icmp_seq=2 ttl=64 time=0.059 ms --- fe80::a00:27ff:feff:7100%mybond0 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.039/0.049/0.059/0.010 ms
Create a New Interface with IPv6 Address
Add a new eth2 interface and assign IPv4 and IPv6 addresses:
# nmcli c add type ethernet ifname eth2 con-name eth2 \ ip4 10.8.8.90/24 gw4 10.8.8.2 \ ip6 fc00::10:8:8:90/7 gw6 fc00::10:8:8:2
We can then modify assignments later (use ipv4.gateway if on RHEL 7.2):
# nmcli c mod eth2 ipv4.addresses "10.8.8.91/24 10.8.8.2" ipv4.method manual \ ipv6.addresses "fc00::10:8:8:91/7" ipv6.method manual
Ping all nodes (multicast address) on the local network connected to the mybond0 interface:
# ping6 ff02::1%mybond0
Check IPv6 routing table:
# ip -6 ro|grep -v error fc00::/7 dev mybond0 proto kernel metric 256 fe80::/64 dev mybond0 proto kernel metric 256