Which range of link-local addresses can be assigned to an ipv6-enabled interface?

Overview

This chapter defines and covers the configuration method, configuration examples, and other information related to Internet Protocol version 6 (IPv6) link-local addresses.

IPv6 Address Structure and Classification

An IPv6 link-local address is a type of IPv6 unicast address. This section briefly introduces an IPv6 address's structure and classification.

IPv6 Address Structure

An IPv6 address is composed of two parts:

  • Network prefix: It consists of n bits and has the same function as the network ID of an IPv4 address.
  • Interface ID: It consists of (128 – n) bits and is parallel to the host ID of an IPv4 address.

Figure 1-1 illustrates the structure of the IPv6 address 2001:A304:6101:1::E0:F726:4E58 /64.

Figure 1-1 Structure of the IPv6 address 2001:A304:6101:1::E0:F726:4E58 /64

IPv6 Address Types

IPv6 addresses are classified into the following three types: unicast, anycast, and multicast.

  • Unicast address: identifies a single network interface and is similar to an IPv4 unicast address. A packet sent to a unicast address is transmitted to a unique interface, which is identified by this address.

    Unicast addresses can be sub-classified further into four types, as shown in Table 1-1.

Table 1-1 IPv6 unicast address types

Address Type

Binary Prefix

IPv6 Prefix ID

Link-local unicast address

1111111010

FE80::/10

Unique local unicast address

1111110

FC00::/7

Loopback address

00...1 (128 bits)

::1/128

Unspecified address

00...0 (128 bits)

::/128

Global unicast address

Others

-

Each unicast address type is defined as follows:

  • Link-local unicast address: used in the Neighbor Discovery Protocol (NDP) and in the communication between nodes on the local link during stateless address autoconfiguration. A packet with the link-local unicast address as the source or destination address is only forwarded on the local link. The link-local unicast address can be automatically configured on any interface using the link-local prefix FE80::/10 (1111 1110 10), and the interface ID in the IEEE EUI-64 format (an EUI-64 interface ID can be created from an extended EUI-48 bit MAC address).
  • Unique local unicast address: identifies a single site and has a globally unique prefix. Sites use unique local unicast addresses to establish private connections, which ensures there are no conflicts between addresses. Even if the routes destined for unique local unicast addresses leak, the routes do not conflict with the Internet routes. Upper-layer applications use unique local unicast addresses as global unicast addresses.
  • Loopback address: is expressed as 0:0:0:0:0:0:0:1 or ::1 and not assigned to any physical interface. Similar to the IPv4 loopback address 127.0.0.1, the IPv6 loopback address indicates that a node sends IPv6 packets to itself.
  • Unspecified address (::): is used in the Source Address field of an IPv6 packet sent by an initializing host before the host obtains an address. A neighbor solicitation (NS) message carries an unspecified address in the Source Address field to perform duplicate address detection (DAD). An unspecified address cannot be assigned to any node or function as a destination address.
  • Global unicast address: is similar to an IPv4 public network address. Global unicast addresses are used on links that can be aggregated, and are provided to the Internet service provider (ISP). The structure of this type of address enables route-prefix aggregation to expand the limited number of global routing entries. A global unicast address consists of a 48-bit route prefix managed by carriers, a 16-bit subnet ID managed by local nodes, and a 64-bit interface ID. Unless otherwise specified, global unicast addresses include site-local unicast addresses.
  • Anycast address: is assigned to a group of interfaces, which usually belong to different nodes. A packet sent to an anycast address is transmitted to only one of the interfaces, typically the nearest one according to distance as defined by the routing protocol.

An anycast address is not necessarily a subnet-router anycast address and can also function as a global unicast address.

  • Multicast address: is assigned to a set of interfaces that belong to different nodes and is similar to an IPv4 multicast address. A packet that is sent to a multicast address is delivered to all the interfaces identified by that address.

    IPv6 addresses do not include broadcast addresses. In IPv6, multicast addresses can provide the functions of broadcast addresses.

Composition of an IPv6 Link-Local Address

According to the classification of IPv6 addresses, an IPv6 link-local address is a type of IPv6 unicast address and is often called a link-local IPv6 unicast address. IPv6 link-local addresses are only used for communication between nodes on the same local link. An IPv6 link-local address consists of the link-local prefix FE80::/10 (the 10 most significant bits are 1111111010) and an interface ID in the IEEE EUI-64 format (an EUI-64 interface ID can be created from an extended EUI-48 bit MAC address).

After IPv6 is enabled on a node and the system is enabled to automatically generate an IPv6 link-local address or a global IPv6 unicast address is manually configured, an IPv6 link-local address is automatically assigned to each interface on the node. This mechanism enables two IPv6 nodes on a link to communicate with each other without any additional configuration. Therefore, IPv6 link-local addresses are widely used in scenarios, such as neighbor discovery and stateless address configuration. Routing devices do not forward IPv6 packets with an IPv6 link-local address as a source or destination address to devices on different links. Figure 1-2 shows the format of an IPv6 link-local address.

Figure 1-2 Format of an IPv6 link-local address

Generation Method of an IPv6 Link-Local Address

When IPv6 is enabled on an interface, an IPv6 link-local address can be configured for the interface in any of the following ways:

  • After a global IPv6 unicast address is configured on the interface, an IPv6 link-local address is automatically generated.
  • After the ipv6 address auto link-local command is run on the interface, an IPv6 link-local address is automatically generated.
  • By running the ipv6 address link-local command, an IPv6 link-local address can be manually specified for the interface.

The rules for generating an IPv6 link-local address are not unique. Automatically generating such an address may cause address conflicts. Therefore, an IPv6 link-local address can be automatically generated or manually configured according to the protocol definition.

Note that only one IPv6 link-local address can be configured on a physical interface.

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The interface view is displayed.

  3. Perform either of the following operations according to on-site requirements:
    • To enable the system to automatically generate an IPv6 link-local address for the interface, run the ipv6 address auto link-local command.
    • To manually configure an IPv6 link-local address for the interface, run the ipv6 address ipv6-address link-local command.
  4. Run commit

    The configuration is committed.

Configuration Examples

Networking Requirements

As shown in Figure 1-3, Devices A and B are connected through GE interfaces. To check the automatic generation and interworking of IPv6 link-local addresses, configure global IPv6 unicast addresses 2001:db8::1/32 and 2001:db8::2/32 for each of the interfaces.

Figure 1-3 Configuring IPv6 addresses for the interfaces

Configuration Roadmap

The configuration roadmap is as follows:

  1. Enable IPv6 forwarding on both devices.
  2. Configure global IPv6 unicast addresses for the interfaces.

Procedure

  1. Configure global IPv6 unicast addresses for the interfaces.

    # Configure Device A.

    HUAWEI> system-view 
    [~HUAWEI] sysname DeviceA 
    [*HUAWEI] commit 
    [~DeviceA] interface GigabitEthernet 0/1/0 
    [~DeviceA-GigabitEthernet0/1/0] ipv6 enable 
    [*DeviceA-GigabitEthernet0/1/0] ipv6 address 2001:db8::1 32 
    [*DeviceA-GigabitEthernet0/1/0] undo shutdown 
    [*DeviceA-GigabitEthernet0/1/0] commit 
    [~DeviceA-GigabitEthernet0/1/0] quit

    # Configure Device B.

    <HUAWEI> system-view 
    [~HUAWEI] sysname DeviceB 
    [*HUAWEI] commit 
    [~DeviceB] interface GigabitEthernet 0/1/0 
    [~DeviceB-GigabitEthernet0/1/0] ipv6 enable 
    [*DeviceB-GigabitEthernet0/1/0] ipv6 address 2001:db8::2 32 
    [*DeviceB-GigabitEthernet0/1/0] undo shutdown 
    [*DeviceB-GigabitEthernet0/1/0] commit 
    [~DeviceB-GigabitEthernet0/1/0] quit
  2. Verify the configuration.

    View the configured global IPv6 unicast addresses and check the states of the interfaces and the IPv6 protocol. If the states are displayed as up, the configuration is successful.

    # Check the interface information on Device A.

    [~DeviceA] display ipv6 interface GigabitEthernet 0/1/0 
    GigabitEthernet0/1/0 current state : UP 
    IPv6 protocol current state : UP 
    link-local address is FE80::C964:0:B8B6:1 
      Global unicast address(es): 
     2001:db8::1, subnet is 2001:db8::/32 
      Joined group address(es): 
     FF02::1:FF00:1 
     FF02::1:FFB6:1 
     FF02::2 
     FF02::1 
      MTU is 4470 bytes 
      ND DAD is enabled, number of DAD attempts: 1 
      ND reachable time is 1200000 milliseconds 
      ND retransmit interval is 1000 milliseconds 
      Hosts use stateless autoconfig for addresses

    # Check the interface information on Device B.

    [~DeviceB] display ipv6 interface GigabitEthernet 0/1/0 
    GigabitEthernet0/1/0 current state : UP 
    IPv6 protocol current state : UP 
    link-local address is FE80::2D6F:0:7AF3:1 
      Global unicast address(es): 
     2001:db8::2, subnet is 2001:db8::/32 
      Joined group address(es): 
     FF02::1:FF00:2 
     FF02::1:FFF3:1 
     FF02::2 
     FF02::1 
      MTU is 4470 bytes 
      ND DAD is enabled, number of DAD attempts: 1 
      ND reachable time is 1200000 milliseconds 
      ND retransmit interval is 1000 milliseconds 
      Hosts use stateless autoconfig for addresses

    # Ping the IPv6 link-local address of Device B from Device A. Note that you need to use the parameter -i to specify the interface corresponding to the IPv6 link-local address.

    [~DeviceA] ping ipv6 fe80::2d6f:0:7af3:1 -i GigabitEthernet 0/1/0 
      PING FE80::2D6F:0:7AF3:1 : 56  data bytes, press CTRL_C to break 
     Reply from FE80::2D6F:0:7AF3:1 
     bytes=56 Sequence=1 hop limit=64  time = 60 ms 
     Reply from FE80::2D6F:0:7AF3:1 
     bytes=56 Sequence=2 hop limit=64  time = 50 ms 
     Reply from FE80::2D6F:0:7AF3:1 
     bytes=56 Sequence=3 hop limit=64  time = 50 ms 
     Reply from FE80::2D6F:0:7AF3:1 
     bytes=56 Sequence=4 hop limit=64  time = 30 ms 
     Reply from FE80::2D6F:0:7AF3:1 
     bytes=56 Sequence=5 hop limit=64  time = 1 ms 
     
      --- FE80::2D6F:0:7AF3:1 ping statistics --- 
     5 packet(s) transmitted 
     5 packet(s) received 
     0.00% packet loss 
     round-trip min/avg/max = 1/38/60 ms

    # Ping the global IPv6 unicast address of Device B from Device A.

    [~DeviceA] ping ipv6 2001:db8::2 
      PING 2001:db8::2 : 56  data bytes, press CTRL_C to break 
     Reply from 2001:db8::2 
     bytes=56 Sequence=1 hop limit=64  time = 30 ms 
     Reply from 2001:db8::2 
     bytes=56 Sequence=2 hop limit=64  time = 50 ms 
     Reply from 2001:db8::2 
     bytes=56 Sequence=3 hop limit=64  time = 50 ms 
     Reply from 2001:db8::2 
     bytes=56 Sequence=4 hop limit=64  time = 20 ms 
     Reply from 2001:db8::2 
     bytes=56 Sequence=5 hop limit=64  time = 40 ms 
     
      --- 2001:db8::2 ping statistics --- 
     5 packet(s) transmitted 
     5 packet(s) received 
     0.00% packet loss 
     round-trip min/avg/max = 20/38/50 ms

Configuration Files

  • Device A configuration file
    #
     sysname DeviceA
    #
    admin
    interface GigabitEthernet0/1/0
    undo shutdown
    ipv6 enable
    ipv6 address 2001:db8::1/32
    #
    return
  • Device B configuration file
    #
     sysname DeviceB
    #
    admin
    interface GigabitEthernet0/1/0
    undo shutdown
    ipv6 enable
    ipv6 address 2001:db8::2/32
    #
    return

Relevant Information

  • Overview
  • Understanding an IPv6 Link-Local Address
    • IPv6 Address Structure and Classification
    • Composition and Generation Method of an IPv6 Link-Local Address
  • Configuring an IPv6 Link-Local Address
  • Configuration Examples
  • Relevant Information

By default, IPv6 configures link-local IP addresses for each interface corresponding to installed Ethernet network adapters. Link-local addresses have the prefix fe80::/64. The last 64 bits of the IPv6 address is known as the interface identifier and is derived from the 48-bit MAC address of the network adapter.
In the Internet Protocol Version 6 (IPv6), the address block fe80::/10 has been reserved for link-local unicast addressing.
IPv6 link-local addresses are addresses that can be used to communicate with nodes (hosts and routers) on an attached link. Packets with those addresses are not forwarded by routers. At least, they should not be. There have been cases where routers would happily forward packets with a link-local source address.
The link-local address is not used as a destination address of any of the host's off-net packets, but rather, is just a way for the host to learn the MAC address of the next-hop router that will forward the host's IPv6 packets onward to the destination address.