Can I use the prefix length except for 64 bits in IPv6 Router Advertisement.

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 6.x
  • Red Hat Enterprise Linux 7.x
  • Red Hat Enterprise Linux 8.x

Issue

  • I am using the 56 bits long prefix in IPv6 router, and it's advertised as a prefix for the subnet.
  • I tried to install Red Hat Enterprise Linux 6.5 on this IPv6 network, but it failed since the network interface was not configured properly.
  • When I used the 64 bits long prefix, the problem doesn't occur.

Resolution

  • The prefix in Router Advertisement is required to be 64 bits long. Use DHCPv6 or a static IP address for prefix length except for 64 bits.

  • For assigning IPv6 address with any prefix statically, use the --ipv6 option of the network kickstart command.

--ipv6=3ffe:ffff:0:1::1/56
interface enp1s0
{
  AdvSendAdvert on;
  AdvManagedFlag on;
  AdvOtherConfigFlag on;

  prefix 2001:db8:0:1::/64 {   <-----------
  };
};

Root Cause

  • The kernel doesn't accept the prefix length except for 64 bits. It can output an error "IPv6 addrconf: prefix with wrong length 56" when 56 bits length is used.

Diagnostic Steps

  • addrconf_prefix_rcv() in net/ipv6/addrconf.c
                if (pinfo->prefix_len == 64) {
...
                        goto ok;
                }
                if (net_ratelimit())
                        printk(KERN_DEBUG "IPv6 addrconf: prefix with wrong length %d\n",
                               pinfo->prefix_len);
                in6_dev_put(in6_dev);
                return;
  • This code means that it can process successfully only when the prefix length is 64. When 56 is used as a prefix length, the error should be output "IPv6 addrconf: prefix with wrong length 56".

  • In the RFC 4291 (http://tools.ietf.org/rfc/rfc4291.txt):

2.5.  Unicast Addresses
...
   |          n bits               |           128-n bits            |
   +-------------------------------+---------------------------------+
   |       subnet prefix           |           interface ID          |
   +-------------------------------+---------------------------------+
...
2.5.1.  Interface Identifiers
...
   For all unicast addresses, except those that start with the binary
   value 000, Interface IDs are required to be 64 bits long and to be
   constructed in Modified EUI-64 format.
  • This means subnet prefix also is needed to be 64 bits long in router advertisement, because the interface ID are required to be 64 bits long of 128 bits.
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.