Configure Unique Local IPv6 Addresses on RHEL 7

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:

fe80:7eef:0000:0000:1000:002a:0003:0001

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:

fe80:7eef::1000:2a:3:1

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.

Link-local Addresses

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.

Configure IPv6

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

Troubleshooting IPv6

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

26 thoughts on “Configure Unique Local IPv6 Addresses on RHEL 7

  1. what if I lost my domain name whenever I configure static ipv6 and turns the system into localhost ?
    the used steps are :
    #ip a
    #nmcli con mod “Systemeth0” ipv6.addr fddb:fe2a:ab1e::coa8/64 ipv6.method manual
    #nmcli con up “Systemeth0”
    sometimes #nmcli con reload
    #ping6 ipv6addr%eth0
    then after rebooting the system turns into localhost.. I am seeking information for RHCE7 examination. Please help me.

  2. Does that fine in the RH300 exam. Is that the proper way. Is there any mistakes in those commands and do I need to set the gateway for ipv6 by static but we aren’t provided with an ipv6 gateway in the exam. hostnamectl is the method I need to use ?

    • The hostnamectl command is a proper way of setting up a hostname. Not sure what you mean by mistakes.

      In terms of a gateway, it depends, if the question asks you to configure one, then you need to do that, otherwise it should not be required. It really depends on a question.

  3. during the exam i support we will be required to setup teaming on both servers,
    so in this case we will be needing to setup ipv6 with the teaming feature ??
    or we can setup the ipv6 separately and let the teaming run separately on ipv4.
    thanks for clarification.

    • This information will be provided during the exam, but in essence, you need to know how to configure teaming or bonding with IPv6.

  4. There might be a typo above:

    On the line that says: “followed by the MAC address 08:00:27:ff:71:00 of the network card, where fffe is inserted in the middle of the”

    Could the “fffe” be “feff”? As the address is “inet6 fe80::a00:27ff:feff:7100/64 scope link”

    • There is no typo, the fffe is in bold: fe80::a00:27ff:feff:7100/64.

      The confusion is caused by the fact that the MAC address already contains “ff”.

      A better example would be a MAC 00:11:22:33:44:55. In this case we would have:

      inet6 fe80::211:22ff:fe33:4455/64 scope link
  5. Hi Tomas,

    when I’m trying to add ipv6 on team0 and then network restart works fine, but after reboot it doesn’t. (I can’t ping fc00::7)
    example:
    nmcli connection modify team0 ipv6.addresses fc00::10/7 ipv6.method manual

    could you please provide me with the solution.

    Thanks in advance

  6. Hi Tomas,

    Here is the output:

    [root@server1 ~]# ip -6 route
    unreachable ::/96 dev lo metric 1024 error -113
    unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -113
    fc::1 dev nm-team proto static metric 350
    unreachable 2002:a00::/24 dev lo metric 1024 error -113
    unreachable 2002:7f00::/24 dev lo metric 1024 error -113
    unreachable 2002:a9fe::/32 dev lo metric 1024 error -113
    unreachable 2002:ac10::/28 dev lo metric 1024 error -113
    unreachable 2002:c0a8::/32 dev lo metric 1024 error -113
    unreachable 2002:e000::/19 dev lo metric 1024 error -113
    unreachable 3ffe:ffff::/32 dev lo metric 1024 error -113
    fc00::/7 dev nm-team proto kernel metric 256
    fe80::/64 dev nm-team proto kernel metric 256
    default via fc::1 dev nm-team proto static metric 350
    [root@server1 ~]#

    No, IPV6 assigned before system reboot.

    Thank you

    • This is the routing table, but what’s the ping error reply that you get?

      Are you saying that after you restart the system the IPv6 address is not automatically assigned on boot?

  7. Hi Tomas,

    Here is the ping

    [root@server1 ~]# ping6 fc00::10
    PING fc00::10(fc00::10) 56 data bytes
    From ::1 icmp_seq=1 Destination unreachable: Address unreachable
    From ::1 icmp_seq=2 Destination unreachable: Address unreachable
    From ::1 icmp_seq=3 Destination unreachable: Address unreachable
    From ::1 icmp_seq=4 Destination unreachable: Address unreachable
    From ::1 icmp_seq=5 Destination unreachable: Address unreachable
    From ::1 icmp_seq=6 Destination unreachable: Address unreachable
    From ::1 icmp_seq=7 Destination unreachable: Address unreachable
    From ::1 icmp_seq=8 Destination unreachable: Address unreachable
    ^C
    — fc00::10 ping statistics —
    8 packets transmitted, 0 received, +8 errors, 100% packet loss, time 7003ms

    after that I need to restart network, and it works, I don’t understand why.

    my steps.
    1. system boot
    2. restart network

    but why I need to restart the network? — that’s a big question for me.

    • Can you post the config file for the teamed interface? Are there any IPv6/network related errors in the system journal after you reboot the server?

    • I have a similar issue.
      dmesg output :
      [ 6.852644] nm-team: Port device eth2 added
      [ 7.539778] IPv6: nm-team: IPv6 duplicate address fe80::a5f9:817b:cd1c:853c detected!
      [ 7.713657] IPv6: nm-team: IPv6 duplicate address fc00::10:8:8:82 detected!
      [ 8.510707] IPv6: nm-team: IPv6 duplicate address fe80::e0ae:3801:c62a:3c7a detected!
      [ 9.123686] IPv6: nm-team: IPv6 duplicate address fe80::dc80:46f2:3d4d:abb8 detected!

      ip a s output :
      5: nm-team: mtu 1500 qdisc noqueue state UP qlen 1000
      link/ether 8e:63:e8:f1:9b:6c brd ff:ff:ff:ff:ff:ff
      inet 192.168.122.82/24 brd 192.168.122.255 scope global nm-team
      valid_lft forever preferred_lft forever
      inet6 fc00::10:8:8:82/7 scope global tentative dadfailed
      valid_lft forever preferred_lft forever
      inet6 fe80::dc80:46f2:3d4d:abb8/64 scope link tentative dadfailed
      valid_lft forever preferred_lft forever
      inet6 fe80::e0ae:3801:c62a:3c7a/64 scope link tentative dadfailed
      valid_lft forever preferred_lft forever
      inet6 fe80::a5f9:817b:cd1c:853c/64 scope link tentative dadfailed
      valid_lft forever preferred_lft forever

  8. Hi Everyone,
    I have two silly question if anyone can answer.
    Question1=Copy paste not working between the server and client VM terminals in graphical mode I mean KVMS?RHEL 7
    what is the option to copy and paste? please help so I could save and reduce time in RHCE exam.
    Question2=is there any effect of putting SE Linux enforcing mode but don’t restart the system and make all changes to SE manage context. will the changes take place or not.

    • I recommend using xterm to workaround the copy/paste problem.

      If you change SELinux state from “disabled” to “enforcing”, then you have to restart the system.

  9. Hi Tomas,

    If I have eth0 with IPv4 addresse + IPv4 gateway in DHCP mode:

    Question 1 :
    – Is it possible to do :
    nmcli con mod eth0 ipv6.addresses fc00::10:8:8:71/7 ipv6.method manual ipv6.gateway fc00::10:8:8:2
    – Or do I have to delete and recreate eth0 with IP4 + IP6 static addresses ?

    Question 2 :
    – Is it possible to have an IP4 gateway + an IP6 gateway ?

    Thanks !

  10. i configure the ipv6, the gateway is not given, i use nmcli to configure ipv6.address and ipv6.method.

    I tried to ping the given ip, it says “unknown host”, May I know what do i miss here?

    1. eth0 IPv4 is configured, but it was set to DHCP, though the IPv4 ip is consistent, does it mean i need to change the bootproto of eth0 to non from dhcp and put the address of ipv4?

    Or it will not affect the ipv6? if the eth0 bootproto is DHCP.

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *