The ipv6 nd ra prefix command configures the prefix in an RA packet.
The undo ipv6 nd ra prefix command deletes the prefix in an RA packet.
By default, an RA packet carries only the address prefix configured using the ipv6 address command.
ipv6 nd ra prefix { ipv6-address prefix-length | ipv6-address/prefix-length } valid-lifetime preferred-lifetime [ no-autoconfig ] [ off-link ]
undo ipv6 nd ra prefix { ipv6-address prefix-length | ipv6-address/prefix-length }
ipv6 nd ra prefix default no-advertise
undo ipv6 nd ra prefix default no-advertise
Parameter | Description | Value |
---|---|---|
ipv6-address | Specifies the IPv6 address carried in the RA packet. | 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. | The value is an integer that ranges from 0 to 128. You can calculate the IPv6 prefix carried in the RA packet based on the IPv6 address and prefix length. When stateless autoconfiguration is used, specify the length of address prefix as 64; otherwise, the address will be invalid and RA packets are discarded. |
valid-lifetime | Specifies the valid lifetime of the prefix. The valid lifetime decides the prefix on-link status. |
The value is an integer that ranges from 0 to 4294967295, in seconds. |
preferred-lifetime | Specifies the preferred lifetime of the prefix. The preferred lifetime cannot be larger than the valid lifetime. |
The value is an integer that ranges from 0 to 4294967295, in seconds. |
no-autoconfig | Deletes the A-Flag. If no-autoconfig is specified, a configured prefix cannot be used in stateless address allocation. A-Flag indicates the autonomous address configuration in the prefix option of RA packet. |
- |
off-link | Specifies the O-Flag. If off-link is specified, the prefix carried in the RA packet cannot be allocated to the local link. | - |
default no-advertise | Specifies that RA packets do not carry the default prefix generated based on the interface IPv6 address. | - |
Usage Scenario
If a prefix has been configured using the ipv6 nd ra prefix command, the device advertises both prefixes configured using the ipv6 nd ra prefix and ipv6 address commands.
By default, RA packets carry the default prefix generated based on the interface IPv6 address. If the default setting is not required, run the ipv6 nd ra prefix default no-advertise command.
Prerequisites
The IPv6 function has been enabled on the interface using the ipv6 enable command in the interface view.
Precautions
After a host receives the RA packet with the prefix configured using the ipv6 nd ra prefix command, the host updates the local prefix information.
The prefix configured using the ipv6 nd ra prefix command cannot be fe80:: (prefix of a link-local address), ff00:: (prefix of a multicast address), :: (prefix of an unspecified address), or the prefix that has been used by another interface (including the interface address prefix and prefix carried in RA packets).
The prefix configuring using the ipv6 nd ra prefix command takes precedence over the default prefix generated based on the interface IPv6 address. An RA message can carry a maximum of 10 prefixes. If exactly 10 prefixes have been manually configured, the default prefix will not be carried.
# Configure the prefix in the RA packet on VLANIF100.
<HUAWEI> system-view [HUAWEI] ipv6 [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ipv6 enable [HUAWEI-Vlanif100] undo ipv6 nd ra halt [HUAWEI-Vlanif100] ipv6 nd ra prefix fc00:1::100 128 1000 400 no-autoconfig [HUAWEI-Vlanif100] ipv6 nd ra prefix fc00:2::100 64 1000 400 off-link
# Configure the prefix in the RA packet on 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] undo ipv6 nd ra halt [HUAWEI-GigabitEthernet0/0/1] ipv6 nd ra prefix fc00:1::100 128 1000 400 no-autoconfig [HUAWEI-GigabitEthernet0/0/1] ipv6 nd ra prefix fc00:2::100 64 1000 400 off-link
# Configure RA packets on VLANIF100 not to carry the default prefix.
<HUAWEI> system-view [HUAWEI] ipv6 [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ipv6 enable [HUAWEI-Vlanif100] undo ipv6 nd ra halt [HUAWEI-Vlanif100] ipv6 nd ra prefix default no-advertise