Configuring RA
A device periodically sends Router Advertisement (RA) messages that carry prefixes and flag bits, or responds to the router request messages with RA messages.
Pre-configuration Tasks
Before configuring RA, complete the following tasks:
Connect interfaces and configure physical parameters for the interfaces to ensure that the physical status of the interfaces is Up.
Configure link layer protocol parameters for the interfaces to ensure that the link layer protocol status of the interfaces is Up.
Configure IPv6 addresses for interfaces.
Enabling RA
After enabling RA for a device, the device can advertise RA messages to provide route prefixes for hosts.
Setting Parameters Carried in RA Messages
An RA message can carry parameters, such as the maximum number of hops, prefix, neighbor reachable time, and lifetime of the RA message.
Procedure
- Run system-view
The system view is displayed.
- Run ipv6 nd hop-limit limit
The maximum number of hops through which an RA message passes is set.
- Run interface interface-type interface-number
The interface view is displayed.
- Run ipv6 nd ra prefix default no-advertise
The device is configured not to carry the default address prefix generated based on the interface IPv6 address in an RA message.
- Run ipv6 nd ra prefix ipv6-address prefix-length valid-lifetime preferred-lifetime [ no-autoconfig ] [ off-link ]
The prefix in an RA message is configured.
The address prefix configured using the ipv6 nd ra prefix command has a higher priority than the default address prefix. Considering that an RA message carries a maximum of 17 address prefixes, the default address prefix will not be carried in an RA message to be advertised if 17 address prefixes have been configured.
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. - Run ipv6 nd autoconfig managed-address-flag
The device is configured to carry a flag indicating whether hosts should use stateful autoconfiguration to obtain addresses in an RA message.
- Run ipv6 nd autoconfig other-flag
The device is configured to carry a flag indicating whether hosts should use stateful autoconfiguration to obtain information other than addresses in an RA message.
If the flag indicating whether hosts should use stateful autonegotiation to obtain addresses is set to 1 in an RA message, the flag indicating whether hosts should use stateful autoconfiguration to obtain information other than addresses should also be set to 1.
- Run ipv6 nd nud reachable-time value
The neighbor reachable time is set.
- Run ipv6 nd ra router-lifetime ra-lifetime
The lifetime of an RA message is configured.
The RA message advertisement interval configured using the ipv6 nd ra command must be less than or equal to the lifetime of an RA message.
- Run ipv6 nd ra advertised-mtu disable
The device is configured not to carry the MTU option in an RA message.
- Run commit
The configuration is committed.
(Optional) Setting the RA Message Advertisement Interval
You can set a smaller RA message advertisement interval to speed up the RA process.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The interface view is displayed.
- Run ipv6 nd ra { max-interval maximum-interval | min-interval minimum-interval }
The RA message advertisement interval is set.
The maximum interval must be greater than 4/3 of the minimum interval.
- Run commit
The configuration is committed.
(Optional) Configuring the Default Router Priority and Route Information
Router Advertisement (RA) packets that carry the default router priority and route information can be transmitted over the local link. In this manner, a proper router can be selected to forward packets of a host.
Context
If a host is connected to multiple routers, the host must select a router to forward packets based on the destination addresses of packets. The router can advertise the default router priority and specified route information to the host so that the host can select a proper forwarding router based on the destination addresses of packets.
After receiving the RA packets carrying the route information, the host updates its routing table. When sending packets to another device, the host queries the routing table and selects a proper route to send packets.
When receiving the RA packets that carry the priority of default routers, the host updates its default router table. When sending packets to another device, if there is no route to be selected, the host queries the default router table. Then, the host selects a router with the highest priority on the local link to send packets. If the router is faulty, the host selects another router in descending order of priority.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number
The interface view is displayed.
- Run ipv6 nd ra preference { high | medium | low }
The default router priority is configured in RA packets.
- Run ipv6 nd ra route-information ipv6-address prefix-length lifetime route-lifetime [ preference { high | medium | low } ]
Route information is configured in RA packets.