< Home

ipv6 address

Function

The ipv6 address command configures a site-local address or global unicast address for an interface.

The ipv6 address dhcpv6-prefix command configures an IPv6 address bound to the DHCPv6 PD prefix for an interface.

The undo ipv6 address command deletes a global unicast address from an interface.

The undo ipv6 address dhcpv6-prefix command deletes the IPv6 address bound to the DHCPv6 PD prefix for an interface.

By default, no global unicast address is configured for an interface.

By default, no IPv6 address bound to the DHCPv6 PD prefix is configured for an interface.

Format

ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length }

ipv6 address dhcpv6-prefix { ipv6-address prefix-length | ipv6-address/prefix-length }

undo ipv6 address [ ipv6-address prefix-length | ipv6-address/prefix-length ]

undo ipv6 address dhcpv6-prefix

Parameters

Parameter Description Value

ipv6-address

Specifies the IPv6 address of an interface.

The value consists of 128 octets, which are classified into 8 groups. Each group contains 4 hexadecimal numbers in the format X:X:X:X:X:X:X:X.

prefix-length

Specifies the prefix length of an IPv6 address.

An IPv6 address with a 128-bit prefix can be configured only on a loopback interface.

The value is an integer that ranges from 1 to 128.

dhcpv6-prefix

Specifies the prefix assigned to a DHCPv6 PD client.

The value must be an existing prefix assigned to a DHCPv6 PD client.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

A global unicast address is similar to an IPv4 public network address. Global unicast addresses are used on the links that can be summarized, and are provided for the Internet Service Providers (ISPs). These addresses allow route prefix summarization, limiting 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.

The switch is required to function as a DHCPv6 PD client and obtain an IPv6 address prefix from the DHCPv6 PD server. You can run the ipv6 address dhcpv6-prefix { ipv6-address prefix-length | ipv6-address/prefix-length } command to configure an IPv6 address is bound to the DHCPv6 PD prefix. After you run this command, the switch uses the prefix assigned to the DHCPv6 PD client and the IPv6 address to form an RA prefix for the interface only when the switch functions as a DHCPv6 PD client and obtains a prefix. The prefix must be a 64-digit number. If not, the host cannot use this prefix for automatic assignment of IPv6 addresses.

Prerequisites

The IPv6 function has been enabled on the interface using the ipv6 enable command in the interface view.

Precautions

The following conditions are prohibited for different interfaces on the same switch:
  • The IPv6 addresses are the same.
  • The network prefixes of the IPv6 addresses are the same. For example, if the IPv6 address of interface A is 2001:db8::1/12 and its network prefix is 200:: and the IPv6 address of interface B is 2001:db8::1/127 and its network prefix is 2001:db8::, the configuration succeeds. If the IPv6 address of interface B is also 2002:db8::1/12 and its network prefix is also 200::, the configuration fails.

A maximum of 10 global unicast addresses can be configured for an interface.

An IPv6 address with a 128-bit prefix can be configured only on a loopback interface.

The following IPv6 addresses cannot be configured for an interface:

  • Loopback address (::1/128)

  • Unspecified address (::/128)

  • Multicast address

  • IPv4-mapped IPv6 address (0:0:0:0:0:FFFF:IPv4-address)

A 128-bit IPv6 address has two formats:
  • X:X:X:X:X:X:X:X

    In this format, a 128-bit IPv6 address is written as eight groups of four hexadecimal digits (0 to 9, A to F), where each group is separated by a colon (:). Every X represents a group of hexadecimal numbers.

  • X:X:X:X:X:X:d.d.d.d

    In this format, "X:X:X:X:X:X" represent the high-order six groups of numbers, and each X stands for 16 bits that are represented by four hexadecimal characters. "d.d.d.d" represents the low-order four groups of numbers, and each d stands for 8 bits that are represented by decimal numbers. "d.d.d.d" stands for a standard IPv4 address.

An IPv6 address has two parts:
  • Network prefix: corresponds to the network ID of an IPv4 address. It is of n bits.
  • Interface identifier: corresponds to the host ID of an IPv4 address. It is of 128-n bits.

If the ipv6 address command has been run to configure an IPv6 address for an interface, but no link-local address is configured for the interface, the system generates a link-local address for the interface.

If no parameter (IPv6 address or prefix length) is specified in the undo ipv6 address command, running the undo ipv6 address command deletes all IPv6 addresses.

Example

# Configure a global unicast address for VLANIF100.

<HUAWEI> system-view
[HUAWEI] ipv6
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ipv6 enable
[HUAWEI-Vlanif100] ipv6 address fc00::1/64

# Configure a global unicast address for GE0/0/1.

<HUAWEI> system-view
[HUAWEI] ipv6
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] ipv6 enable
[HUAWEI-GigabitEthernet0/0/1] ipv6 address fc00::1/64

# Configure an IPv6 address bound to the DHCPv6 PD prefix for VLANIF100.

<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ipv6 enable
[HUAWEI-Vlanif100] ipv6 address prefix1 ::1:0:0:0:1/64
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >