The ipv6 nd ra prefix command configures the prefix carried in RA messages advertised by the device.
The undo ipv6 nd ra prefix command configures RA messages not to carry the specified prefix.
By default, RA messages contain only the address prefixes specified through the ipv6 address command.
ipv6 nd ra prefix { ipv6-address ipv6-prefix-length | ipv6-address/ipv6-prefix-length } valid-lifetime preferred-lifetime [ no-autoconfig ] [ off-link ]
undo ipv6 nd ra prefix { ipv6-address ipv6-prefix-length | ipv6-address/ipv6-prefix-length }
ipv6 nd ra prefix default no-advertise
undo ipv6 nd ra prefix default no-advertise
| Parameter | Description | Value |
|---|---|---|
ipv6-address ipv6-prefix-length or ipv6-address/ipv6-prefix-length |
Specifies the IPv6 address and the prefix length. |
The prefix length is an integer, ranging from 0 to 128. You can calculate the IPv6 prefix of the advertised route based on the IPv6 address and the prefix length. When allocating the IPv6 address by means of stateless auto-configuration, specify the length of address prefixes as 64 bites. Otherwise, the address will be invalid and RA messages will be discarded. |
valid-lifetime |
Specifies the valid lifetime. |
It is an integer ranging from 0 to 4294967295 seconds. The default value is 2592000. |
preferred-lifetime |
Specifies the preferred lifetime. |
It is an integer ranging from 0 to 4294967295 seconds. The preferred lifetime cannot be bigger than the valid lifetime. The default value is 604800. |
no-autoconfig |
Indicates the A-Flag (disabling). If this parameter is used, the configured prefix is not used for stateless address configuration. |
- |
off-link |
Indicates the O-Flag (disabling). If this parameter is used, the configured prefix is not allocated to a local link. |
- |
default no-advertise |
Indicates that RA messages do not carry the default prefix generated based on the interface IPv6 address. |
- |
Ethernet interface view, Eth-Trunk interface view, Tunnel interface view, VLANIF interface view, BDIF interface view
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.
Prerequisites
The ipv6 enable command has been run in the interface view to enable IPv6.
Configuration Impact
After a host receives RA message in which the prefix is configured using the ipv6 nd ra prefix command, the host updates the local prefix information.
Precautions
The prefix configured 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 10 address prefixes are configured, the default address prefix will not be advertised through an RA message.
# On an GigabitEthernet interface, configure the prefix message to be advertised by the device.
<sysname> system-view
[sysname] interface GigabitEthernet 0/0/0
[sysname-GigabitEthernet0/0/0] ipv6 enable
[sysname-GigabitEthernet0/0/0] ipv6 nd ra prefix 2001:db8:1::2/64 100 10
[sysname-GigabitEthernet0/0/0] ipv6 nd ra prefix 2001:db8:2::2/128 1000 400 no-autoconfig
[sysname-GigabitEthernet0/0/0] ipv6 nd ra prefix 2001:db8:3::2/64 1000 400 off-link