Configuring parameters for RA messages
You can enable an interface to send RA messages, and configure the interval for sending RA messages and parameters in RA messages. After receiving an RA message, a host can use these parameters to perform corresponding operations. Table 10 describes the configurable parameters in an RA message.
Table 10: Parameters in an RA message and their descriptions
Parameter | Description |
---|---|
Hop Limit | Maximum number of hops in RA messages. A host receiving the RA message fills the value in the Hop Limit field of sent IPv6 packets. |
Prefix information | After receiving the prefix information, the hosts on the same link can perform stateless autoconfiguration. |
MTU | Guarantees that all nodes on the link use the same MTU. |
M flag | Determines whether a host uses stateful autoconfiguration to obtain an IPv6 address. If the M flag is set to 1, the host uses stateful autoconfiguration (for example, from a DHCPv6 server) to obtain an IPv6 address. Otherwise, the host uses stateless autoconfiguration to generate an IPv6 address according to its link-layer address and the prefix information in the RA message. |
O flag | Determines whether a host uses stateful autoconfiguration to obtain configuration information other than IPv6 address. If the O flag is set to 1, the host uses stateful autoconfiguration (for example, from a DHCPv6 server) to obtain configuration information other than IPv6 address. Otherwise, the host uses stateless autoconfiguration. |
Router Lifetime | Tells the receiving hosts how long the advertising router can live. If the lifetime of a router is 0, the router cannot be used as the default gateway. |
Retrans Timer | If the device does not receive a response message within the specified time after sending an NS message, it retransmits the NS message. |
Reachable Time | If the neighbor reachability detection shows that a neighbor is reachable, the device considers the neighbor reachable within the specified reachable time. If the device needs to send a packet to the neighbor after the specified reachable time expires, the device reconfirms whether the neighbor is reachable. |
Router Preference | Specifies the router preference in a RA message. A host selects a router as the default gateway according to the router preference. If router preferences are the same, the host selects the router from which the first RA message is received. |
The maximum interval for sending RA messages should be less than (or equal to) the router lifetime in RA messages. In this way, the router can be updated by an RA message before expiration.
The values of the NS retransmission timer and the reachable time configured for an interface are sent in RA messages to hosts. This interface sends NS messages at the interval of the NS retransmission timer and considers a neighbor reachable within the reachable time.
Enabling sending of RA messages
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter interface view. | interface interface-type interface-number | N/A |
3. Enable sending of RA messages. | undo ipv6 nd ra halt | The default setting is disabled. |
4. Set the maximum and minimum intervals for sending RA messages. | ipv6 nd ra interval max-interval min-interval | By default, the maximum interval for sending RA messages is 600 seconds, and the minimum interval is 200 seconds. The device sends RA messages at random intervals between the maximum interval and the minimum interval. The minimum interval should be less than or equal to 0.75 times the maximum interval. |
Configuring parameters for RA messages
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter interface view. | interface interface-type interface-number | N/A |
3. Configure the prefix information in RA messages. | ipv6 nd ra prefix { ipv6-prefix prefix-length | ipv6-prefix/prefix-length } [ valid-lifetime preferred-lifetime [ no-autoconfig | off-link ] * | no-advertise ] | By default, no prefix information is configured for RA messages, and the IPv6 address of the interface sending RA messages is used as the prefix information. If the IPv6 address is manually configured, the prefix uses a fixed valid lifetime of 2592000 seconds (30 days) and a preferred lifetime of 604800 seconds (7 days). If the IPv6 address is automatically obtained, the prefix uses the valid lifetime and preferred lifetime configured for the IPv6 address. |
4. Configure the default settings for prefixes advertised in RA messages. | ipv6 nd ra prefix default [ valid-lifetime preferred-lifetime [ no-autoconfig | off-link ] * | no-advertise ] | By default, no default settings are configured for prefixes advertised in RA messages. |
5. Turn off the MTU option in RA messages. | ipv6 nd ra no-advlinkmtu | By default, RA messages contain the MTU option. |
6. Specify unlimited hops in RA messages. | ipv6 nd ra hop-limit unspecified | By default, the maximum number of hops in RA messages is 64. |
7. Set the M flag bit to 1. | ipv6 nd autoconfig managed-address-flag | By default, the M flag bit is set to 0 in RA advertisements. Hosts receiving the advertisements will obtain IPv6 addresses through stateless autoconfiguration. |
8. Set the O flag bit to 1. | ipv6 nd autoconfig other-flag | By default, the O flag bit is set to 0 in RA advertisements. Hosts receiving the advertisements will acquire other configuration information through stateless autoconfiguration. |
9. Set the router lifetime in RA messages. | ipv6 nd ra router-lifetime time | By default, the router lifetime is 1800 seconds. |
10. Set the NS retransmission timer. | ipv6 nd ns retrans-timer value | By default, an interface sends NS messages every 1000 milliseconds, and the value of the Retrans Timer field in RA messages is 0. |
11. Set the router preference in RA messages. | ipv6 nd router-preference { high | low | medium } | By default, the router preference is medium. |
12. Set the reachable time. | ipv6 nd nud reachable-time time | By default, the neighbor reachable time is 30000 milliseconds, and the value of the Reachable Time field in sent RA messages is 0. |