- Table of Contents
-
- 05-Layer 3—IP Routing Configuration Guide
- 00-Preface
- 01-Basic IP routing configuration
- 02-Static routing configuration
- 03-RIP configuration
- 04-OSPF configuration
- 05-Policy-based routing configuration
- 06-IPv6 static routing configuration
- 07-RIPng configuration
- 08-OSPFv3 configuration
- 09-IPv6 policy-based routing configuration
- 10-Routing policy configuration
- 11-DCN configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
01-Basic IP routing configuration | 149.66 KB |
Contents
Setting the maximum lifetime for routes and labels in the RIB
Setting the maximum lifetime for routes in the FIB
Configuring BFD for primary route next hop availability detection
About configuring BFD for primary route next hop detection
Configuring BFD control packet mode
Configuring BFD echo packet mode
Configuring routing policy-based recursive lookup
Setting the maximum number of active routes supported by the device
Configuring RIB SNMP notifications
Display and maintenance commands for basic IP routing
Configuring basic IP routing
This chapter focuses on unicast routing protocols. For more information about multicast routing protocols, see IP Multicast Configuration Guide.
About IP routing
IP routing directs IP packet forwarding on routers. Based on the destination IP address in the packet, a router looks up a route for the packet in a routing table and forwards the packet to the next hop. Routes are path information used to direct IP packets.
Routing table
A RIB contains the global routing information and related information, including route recursion, route redistribution, and route extension information. The router selects optimal routes from the routing table and puts them into the FIB table. It uses the FIB table to forward packets. For more information about the FIB table, see Layer 3—IP Services Configuration Guide.
Route categories
Table 1 categorizes routes by different criteria.
Criterion |
Categories |
Origin |
· Direct route—A direct route is discovered by the data link protocol on an interface, and is also called an interface route. · Static route—A static route is manually configured by an administrator. · Dynamic route—A dynamic route is dynamically discovered by a routing protocol. |
Destination |
· Network route—The destination is a network. The subnet mask is less than 32 bits. · Host route—The destination is a host. The subnet mask is 32 bits. |
Whether the destination is directly connected |
· Direct route—The destination is directly connected. · Indirect route—The destination is indirectly connected. |
Dynamic routing protocols
Static routes work well in small, stable networks. They are easy to configure and require fewer system resources. However, in networks where topology changes occur frequently, a typical practice is to configure a dynamic routing protocol. Compared with static routing, a dynamic routing protocol is complicated to configure, requires more router resources, and consumes more network resources.
Dynamic routing protocols dynamically collect and report reachability information to adapt to topology changes. They are suitable for large networks.
Dynamic routing protocols can be classified by different criteria, as shown in Table 2.
Table 2 Categories of dynamic routing protocols
Criterion |
Categories |
Operation scope |
· IGPs—Work within an AS. · EGPs—Work between ASs. |
Routing algorithm |
· Distance-vector protocols—Examples include RIP. · Link-state protocols—Examples include OSPF. |
Destination address type |
· Unicast routing protocols—Examples include RIP and OSPF. · Multicast routing protocols—Examples include PIM-SM and PIM-DM. |
IP version |
· IPv4 routing protocols—Examples include RIP and OSPF. · IPv6 routing protocols—Examples include RIPng and OSPFv3. |
An AS refers to a group of routers that use the same routing policy and work under the same administration.
Route preference
Routing protocols, including static and direct routing, each by default have a preference. If they find multiple routes to the same destination, the router selects the route with the highest preference as the optimal route.
The preference of a direct route is always 0 and cannot be changed. You can configure a preference for each static route and each dynamic routing protocol. The following table lists the route types and default preferences. The smaller the value, the higher the preference.
Table 3 Route types and default route preferences
Route type |
Preference |
Direct route |
0 |
Multicast static route |
1 |
OSPF |
10 |
Unicast static route |
60 |
RIP |
100 |
OSPF ASE |
150 |
OSPF NSSA |
150 |
Unknown (route from an untrusted source) |
256 |
Route redistribution
Route redistribution enables routing protocols to learn routing information from each other. A dynamic routing protocol can redistribute routes from other routing protocols, including direct and static routing. For more information, see the respective chapters on those routing protocols in this configuration guide.
The RIB records redistribution relationships of routing protocols.
Setting the maximum lifetime for routes and labels in the RIB
About this task
Perform this task to prevent routes of a certain protocol from being aged out due to slow protocol convergence resulting from a large number of route entries or long GR period.
Restrictions and guidelines
The configuration takes effect at the next protocol or RIB process switchover.
Procedure (IPv4)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv4 address family and enter its view.
address-family ipv4
4. Set the maximum lifetime for IPv4 routes and labels in the RIB.
protocol protocol lifetime seconds
By default, the maximum lifetime for routes and labels in the RIB is 900 seconds.
Procedure (IPv6)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv6 address family and enter its view.
address-family ipv6
4. Set the maximum lifetime for IPv6 routes and labels in the RIB.
protocol protocol lifetime seconds
By default, the maximum lifetime for routes and labels in the RIB is 900 seconds.
Setting the maximum lifetime for routes in the FIB
About this task
When GR or NSR is disabled, FIB entries must be retained for some time after a protocol process switchover or RIB process switchover. When GR or NSR is enabled, FIB entries must be removed immediately after a protocol or RIB process switchover to avoid routing issues. Perform this task to meet such requirements.
Procedure (IPv4)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv4 address family and enter its view.
address-family ipv4
4. Set the maximum lifetime for IPv4 routes in the FIB.
fib lifetime seconds
By default, the maximum lifetime for routes in the FIB is 600 seconds.
Procedure (IPv6)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv6 address family and enter its view.
address-family ipv6
4. Set the maximum lifetime for IPv6 routes in the FIB.
fib lifetime seconds
By default, the maximum lifetime for routes in the FIB is 600 seconds.
Configuring RIB NSR
About this task
When an active/standby switchover occurs, nonstop routing (NSR) backs up routing information from the active process to the standby process to avoid routing flapping and ensure forwarding continuity.
RIB NSR provides faster route convergence than protocol NSR during an active/standby switchover.
Restrictions and guidelines
Use this feature with protocol GR or NSR to avoid route timeouts and traffic interruption.
Procedure (IPv4)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv4 address family and enter its view.
address-family ipv4
4. Enable IPv4 RIB NSR.
non-stop-routing
By default, RIB NSR is disabled.
Procedure (IPv6)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv6 address family and enter its view.
address-family ipv6
4. Enable IPv6 RIB NSR.
non-stop-routing
By default, RIB NSR is disabled.
Configuring BFD for primary route next hop availability detection
About configuring BFD for primary route next hop detection
This feature uses BFD to detect the availability of the primary route next hop for inter-protocol FRR. When the primary route next hop unreachable, this feature enables the upper layer routing protocol to reallocate service traffic to the backup next hops.
For inter-protocol FRR, the primary route is the route with the highest preference among the routes to the same destination. If BFD detects that the next hop of the primary route is unreachable, it notifies the FIB of the issue. The FIB will use the backup next hops to guide traffic forwarding.
For more information about BFD, see High Availability Configuration Guide.
Configuring BFD control packet mode
About this task
This mode uses BFD control packets to detect the status of a link bidirectionally at a millisecond level.
Restrictions and guidelines for BFD control packet mode
A control-packet-mode BFD session can be successfully established through negotiation between the two ends. To use a control-packet-mode BFD session to detect the primary route next hop availability, you must create a static BFD session that meets the following requirements on the next hop device:
· Create a single-hop BFD session in control packet mode.
· The source IP address of the BFD session is the destination IP address of the BFD session automatically created by the local end.
· The destination IP address of the BFD session is the source IP address of the BFD session automatically created by the local end.
· The remote discriminator of the BFD session is the local discriminator of the BFD session automatically created by the local end.
The local device can use a control-packet-mode BFD session to detect the primary route next hop only after you create the static BFD session on the primary route next hop device.
Procedure
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create RIB IPv4 or IPv6 address family view and enter the view.
IPv4:
address-family ipv4
IPv6:
address-family ipv6
4. Enable BFD for primary link availability detection.
primary-path-detect bfd ctrl [ inter-protocol-frr ]
By default, BFD is disabled for primary link availability detection.
Configuring BFD echo packet mode
About this task
With BFD echo packet mode enabled, the output interface sends BFD echo packets to the destination device, and the device sends the packets back to test the link reachability.
Restrictions and guidelines
You do not need to configure BFD echo packet mode at the peer end.
Procedure
1. Enter system view.
system-view
2. (Optional.) Configure the source IP address of echo packets.
IPv4:
bfd echo-source-ip ip-address
By default, the source IPv4 address of echo packets is not configured.
As a best practice to avoid network congestion caused by excessive ICMP redirect packets from the peer, use this command. Make sure the source IPv4 address is not on the subnet of any interfaces on the device.
For more information about this command, see BFD in High Availability Command Reference.
IPv6:
bfd echo-source-ipv6 ipv6-address
By default, the source IPv6 address of echo packets is not configured.
As a best practice to avoid network congestion caused by excessive ICMPv6 redirect packets from the peer, use this command. Make sure the source IPv6 address is not on the subnet of any interfaces on the device.
You must specify a global unicast address as the source IPv6 address of BFD echo packets.
For more information about this command, see BFD in High Availability Command Reference.
3. Enter RIB view.
rib
4. Create RIB IPv4 or IPv6 address family view and enter the view.
IPv4:
address-family ipv4
IPv6:
address-family ipv6
5. Enable BFD for primary link availability detection.
primary-path-detect bfd echo [ inter-protocol-frr ]
By default, BFD is disabled for primary link availability detection.
Configuring routing policy-based recursive lookup
About this task
Configure routing policy-based recursive lookup to control route recursion results. For example, when a route changes, the routing protocol has to perform a route recursion if the next hop is indirectly connected. The routing protocol might select an incorrect path, which can cause traffic loss. To prevent this problem, you can use a routing policy to filter out incorrect routes. The routes that pass the filtering of the routing policy will be used for route recursion.
Restrictions and guidelines
The apply clauses in the specified routing policy cannot take effect.
Make sure a minimum of one related route can match the routing policy for correct traffic forwarding.
Procedure (IPv4)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv4 address family and enter its view.
address-family ipv4
4. Configure routing policy-based recursive lookup.
protocol protocol nexthop recursive-lookup route-policy route-policy-name
By default, routing policy-based recursive lookup is not configured.
Setting the maximum number of active routes supported by the device
About this task
To perform this task:
· You can use the routing-table limit number warn-threshold command to specify an alarm threshold. When the percentage of active routes exceeds the alarm threshold, the system generates a system log message but still accepts active routes. You can take relevant actions based on the message to save system resources. If the number of active routes reaches the maximum number, no more routes can be added and new routes are discarded.
· You can use the routing-table limit number simply-alert command to specify an alarm threshold. When the maximum number of active IPv4/IPv6 routes is exceeded, the device still accepts new active routes but generates a system log message. You can take relevant actions based on the message to save system resources.
Procedure (IPv4)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv4 address family and enter its view.
address-family ipv4
4. Set the maximum number of active IPv4 routes supported by the device.
routing-table limit number { warn-threshold | simply-alert }
By default, the maximum number of active IPv4 routes is not set for the device.
Configuration in RIB IPv4 address family view limits the number of active IPv4 routes for the public network and all VPN instances.
Procedure (IPv6)
1. Enter system view.
system-view
2. Enter RIB view.
rib
3. Create the RIB IPv6 address family and enter its view.
address-family ipv6
4. Set the maximum number of active IPv6 routes supported by the device.
routing-table limit number { warn-threshold | simply-alert }
By default, the maximum number of active IPv6 routes is not set for the device.
Configuration in RIB IPv6 address family view limits the number of active IPv6 routes for the public network and all VPN instances.
Enabling MTP
About this task
Use maintenance probe (MTP) to locate faults for routing protocols depending on your network maintenance requirements. MTP enables the device to automatically ping and tracert a neighbor upon expiration of the neighbor hold timer and record the ping and tracert results. To view detailed fault information, use the display commands of routing protocols, for example, the display ospf troubleshooting command. To view detailed MTP information, use the display logbuffer command.
Procedure
1. Enter system view.
system-view
2. Enable MTP.
maintenance-probe enable
By default, MTP is disabled.
Configuring RIB SNMP notifications
About this task
To report critical RIB events to an NMS, enable SNMP notifications for RIB. For SNMP notifications to be sent correctly, you must also configure SNMP on the device. For more information about SNMP configuration, see the network management and monitoring configuration guide for the device.
Procedure (IPv4)
1. Enter system view.
system-view
2. Enable IPv4 RIB SNMP notifications.
snmp-agent trap enable rib [ prefix-exceed | prefix-exceed-clear | prefix-threshold-exceed | prefix-thresholdexceed-clear | public-prefix-exceed | public-prefixexceed-clear | public-prefixthreshold-exceed | public-prefixthresholdexceed-clear | vrf-prefix-exceed | vrf-prefixexceed-clear | vrf-prefixthreshold-exceed | vrf-prefixthresholdexceed-clear ] *
By default, IPv4 RIB SNMP notifications are enabled.
Procedure (IPv6)
1. Enter system view.
system-view
2. Enable IPv6 RIB SNMP notifications.
snmp-agent trap enable ipv6 rib [ prefix-exceed | prefix-exceed-clear | prefix-threshold-exceed | prefix-thresholdexceed-clear | public-prefix-exceed | public-prefixexceed-clear | public-prefixthreshold-exceed | public-prefixthresholdexceed-clear | vrf-prefix-exceed | vrf-prefixexceed-clear | vrf-prefixthreshold-exceed | vrf-prefixthresholdexceed-clear ] *
By default, IPv6 RIB SNMP notifications are enabled.
Display and maintenance commands for basic IP routing
Execute display commands in any view and reset commands in user view.
Task |
Command |
Display routing table information. |
display ip routing-table [ all-vpn-instance | vpn-instance vpn-instance-name ] [ verbose ] display ip routing-table all-routes |
Display information about routes permitted by an IPv4 basic ACL. |
display ip routing-table [ vpn-instance vpn-instance-name ] acl ipv4-acl-number [ verbose ] |
Display information about routes to a specific destination address. |
display ip routing-table [ vpn-instance vpn-instance-name ] ip-address [ mask-length | mask ] [ longer-match ] [ verbose ] |
Display information about routes to a range of destination addresses. |
display ip routing-table [ vpn-instance vpn-instance-name ] ip-address1 to ip-address2 [ verbose ] |
Display information about routes permitted by an IP prefix list. |
display ip routing-table [ vpn-instance vpn-instance-name ] prefix-list prefix-list-name [ verbose ] |
Display information about routes installed by a protocol. |
display ip routing-table [ vpn-instance vpn-instance-name ] protocol protocol [ inactive | verbose ] |
Display IPv4 route statistics. |
display ip routing-table [ all-routes | all-vpn-instance | vpn-instance vpn-instance-name ] statistics |
Display brief IPv4 routing table information. |
display ip routing-table [ vpn-instance vpn-instance-name ] summary |
Display IPv6 RIB GR state information. |
display ipv6 rib graceful-restart |
Display next hop information in the IPv6 RIB. |
display ipv6 rib nib [ self-originated ] [ nib-id ] [ verbose ] display ipv6 rib nib protocol protocol [ verbose ] |
Display next hop information for IPv6 direct routes. |
display ipv6 route-direct nib [ nib-id ] [ verbose ] |
Display IPv6 routing table information. |
display ipv6 routing-table [ all-vpn-instance | vpn-instance vpn-instance-name ] [ verbose ] display ipv6 routing-table all-routes |
Display information about routes permitted by an IPv6 basic ACL. |
display ipv6 routing-table [ vpn-instance vpn-instance-name ] acl ipv6-acl-number [ verbose ] |
Display information about routes to an IPv6 destination address. |
display ipv6 routing-table [ vpn-instance vpn-instance-name ] ipv6-address [ prefix-length ] [ longer-match ] [ verbose ] |
Display information about routes to a range of IPv6 destination addresses. |
display ipv6 routing-table [ vpn-instance vpn-instance-name ] ipv6-address1 to ipv6-address2 [ verbose ] |
Display information about routes permitted by an IPv6 prefix list. |
display ipv6 routing-table [ vpn-instance vpn-instance-name ] prefix-list prefix-list-name [ verbose ] |
Display information about routes installed by an IPv6 protocol. |
display ipv6 routing-table [ vpn-instance vpn-instance-name ] protocol protocol [ inactive | verbose ] |
Display IPv6 route statistics. |
display ipv6 routing-table [ all-routes | all-vpn-instance | vpn-instance vpn-instance-name ] statistics |
Display brief IPv6 routing table information. |
display ipv6 routing-table [ vpn-instance vpn-instance-name ] summary |
Display RIB GR state information. |
display rib graceful-restart |
Display next hop information in the RIB. |
display rib nib [ self-originated ] [ nib-id ] [ verbose ] display rib nib protocol protocol [ verbose ] |
Display next hop information for direct routes. |
display route-direct nib [ nib-id ] [ verbose ] |
Clear IPv4 route statistics. |
reset ip routing-table statistics protocol [ vpn-instance vpn-instance-name ] { protocol | all } reset ip routing-table [ all-routes | all-vpn-instance ] statistics protocol { protocol | all } |
Clear IPv6 route statistics. |
reset ipv6 routing-table statistics protocol [ vpn-instance vpn-instance-name ] { protocol | all } reset ipv6 routing-table [ all-routes | all-vpn-instance ] statistics protocol { protocol | all } |