06-Layer 3 - IP Routing Configuration Guide

HomeSupportSwitchesH3C S7500E-XS Switch SeriesConfigure & DeployConfiguration GuidesH3C S7500E-XS Switch Series Configuration Guides-Release7178-6W10006-Layer 3 - IP Routing Configuration Guide
01-Basic IP routing configuration
Title Size Download
01-Basic IP routing configuration 89.82 KB

Configuring basic IP routing

IP routing directs IP packet forwarding on routers based on a routing table. This chapter focuses on unicast routing protocols. For more information about multicast routing protocols, see IP Multicast Configuration Guide.

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.

Table 1 categorizes routes by different criteria.

Table 1 Route categories

Criterion

Categories

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.

Origin

·     Direct routeA direct route is discovered by the data link protocol on an interface, and is also called an interface route.

·     Static routeA static route is manually configured by an administrator.

·     Dynamic routeA dynamic route is dynamically discovered by a routing protocol.

 

To view brief information about a routing table, use the display ip routing-table command.

<Sysname> display ip routing-table

 

Destinations : 19        Routes : 19

 

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

0.0.0.0/32          Direct 0    0            127.0.0.1       InLoop0

1.1.1.0/24          Direct 0    0            1.1.1.1         XGE1/1/1

1.1.1.0/32          Direct 0    0            1.1.1.1         XGE1/1/1

1.1.1.1/32          Direct 0    0            127.0.0.1       InLoop0

1.1.1.255/32        Direct 0    0            1.1.1.1         XGE1/1/1

2.2.2.0/24          Static 60   0            12.2.2.2        XGE1/1/2

80.1.1.0/24         OSPF   10   2            80.1.1.1        XGE1/1/3

...

A route entry includes the following key items:

·     DestinationIP address of the destination host or network.

·     MaskMask length of the IP address.

·     Pre—Preference of the route. Among routes to the same destination, the route with the highest preference is optimal.

·     Cost—If multiple routes to a destination have the same preference, the one with the smallest cost is the optimal route.

·     NextHopNext hop.

·     InterfaceOutput interface.

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. Examples include RIP, OSPF, and IS-IS.

·     EGPs—Work between ASs. The most popular EGP is BGP.

Routing algorithm

·     Distance-vector protocolsExamples include RIP and BGP. BGP is also considered a path-vector protocol.

·     Link-state protocolsExamples include OSPF and IS-IS.

Destination address type

·     Unicast routing protocolsExamples include RIP, OSPF, BGP, and IS-IS.

·     Multicast routing protocolsExamples include PIM-SM and PIM-DM.

IP version

·     IPv4 routing protocolsExamples include RIP, OSPF, BGP, and IS-IS.

·     IPv6 routing protocolsExamples include RIPng, OSPFv3, IPv6 BGP, and IPv6 IS-IS.

 

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

IS-IS

15

Unicast static route

60

RIP

100

OSPF ASE

150

OSPF NSSA

150

IBGP

255

EBGP

255

Unknown (route from an untrusted source)

256

 

Load sharing

A routing protocol might find multiple optimal equal-cost routes to the same destination. You can use these routes to implement equal-cost multi-path (ECMP) load sharing.

Static routing, IPv6 static routing, RIP, RIPng, OSPF, OSPFv3, BGP, IPv6 BGP, IS-IS, and IPv6 IS-IS support ECMP load sharing.

Route backup

Route backup can improve network availability. Among multiple routes to the same destination, the route with the highest priority is the primary route and others are secondary routes.

The router forwards matching packets through the primary route. When the primary route fails, the route with the highest preference among the secondary routes is selected to forward packets. When the primary route recovers, the router uses it to forward packets.

Route recursion

To use a BGP, static, or RIP route that has an indirectly connected next hop, a router must perform route recursion to find the output interface to reach the next hop.

Link-state routing protocols, such as OSPF and IS-IS, do not need route recursion, because they obtain directly connected next hops through route calculation.

The RIB records and saves route recursion information, including brief information about related routes, recursive paths, and recursion depth.

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.

Extension attribute redistribution

Extension attribute redistribution enables routing protocols to learn route extension attributes from each other, including BGP extended community attributes, OSPF area IDs, route types, and router IDs.

The RIB records extended attributes of each routing protocol and redistribution relationships of different routing protocol extended attributes.

Configuring the maximum lifetime for routes and labels in the RIB

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.

The configuration takes effect at the next protocol or RIB process switchover.

To configure the maximum lifetime for routes and labels in the RIB (IPv4):

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

3.     Create a RIB IPv4 address family and enter RIB IPv4 address family view.

address-family ipv4

By default, no RIB IPv4 address family is created.

4.     Configure 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 480 seconds.

 

To configure the maximum route lifetime for routes and labels in the RIB (IPv6):

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

3.     Create a RIB IPv6 address family and enter RIB IPv6 address family view.

address-family ipv6

By default, no RIB IPv6 address family is created.

4.     Configure 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 480 seconds.

 

Configuring the maximum lifetime for routes in the FIB

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.

To configure the maximum lifetime for routes in the FIB (IPv4):

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

3.     Create a RIB IPv4 address family and enter its view.

address-family ipv4

By default, no RIB IPv4 address family is created.

4.     Configure 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.

 

To configure the maximum lifetime for routes in the FIB (IPv6):

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

3.     Create a RIB IPv6 address family and enter its view.

address-family ipv6

By default, no RIB IPv6 address family is created.

4.     Configure 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 the maximum number of ECMP routes

This configuration takes effect at reboot. Make sure the reboot does not impact your network.

To configure the maximum number of ECMP routes:

 

Step

Command

Remarks

5.     Enter system view.

system-view

N/A

6.     Configure the maximum number of ECMP routes.

max-ecmp-num number

By default, the maximum number of ECMP routes is 16.

 

Configuring RIB NSR

IMPORTANT

IMPORTANT:

Use this feature with protocol GR or NSR to avoid route timeouts and traffic interruption.

 

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.

Configuring IPv4 RIB NSR

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

3.     Create a RIB IPv4 address family and enter its view.

address-family ipv4

By default, no RIB IPv4 address family is created.

4.     Enable IPv4 RIB NSR.

non-stop-routing

By default, RIB NSR is disabled.

 

Configuring IPv6 RIB NSR

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

3.     Create a RIB IPv6 address family and enter its view.

address-family ipv6

By default, no RIB IPv6 address family is created.

4.     Enable IPv6 RIB NSR.

non-stop-routing

By default, RIB NSR is disabled.

 

Displaying and maintaining a routing table

Execute display commands in any view and reset commands in user view.

 

Task

Command

Display the IPv4 ECMP mode.

display ecmp mode

Display routing table information.

display ip routing-table [ vpn-instance vpn-instance-name ] [ verbose ] [ standby slot slot-number ]

Display information about routes permitted by an IPv4 basic ACL.

display ip routing-table [ vpn-instance vpn-instance-name ] acl acl-number [ verbose ] [ standby slot slot-number ]

Display information about routes to a specific destination address.

display ip routing-table [ vpn-instance vpn-instance-name ] ip-address [ mask | mask-length ] [ longer-match ] [ verbose ] [ standby slot slot-number ]

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 ] [ standby slot slot-number ]

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 ] [ standby slot slot-number ]

Display information about routes installed by a protocol.

display ip routing-table [ vpn-instance vpn-instance-name ] protocol protocol [ inactive | verbose ] [ standby slot slot-number ]

Display brief routing table information.

display ip routing-table [ vpn-instance vpn-instance-name ] summary [ standby slot slot-number ]

Display IPv4 route statistics.

display ip routing-table [ vpn-instance vpn-instance-name ] statistics [ standby slot slot-number ]

Display the maximum number of ECMP routes.

display max-ecmp-num

Display route attribute information in the RIB.

display rib attribute [ attribute-id ] [ standby slot slot-number ]

Display RIB GR state information.

display rib graceful-restart

Display next hop information in the RIB.

display rib nib [ self-originated ] [ nib-id ] [ verbose ] [ standby slot slot-number ]

display rib nib protocol protocol-name [ verbose ] [ standby slot slot-number ]

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 } [ standby slot slot-number ]

Display the IPv6 ECMP mode.

display ipv6 ecmp mode

Display IPv6 routing table information.

display ipv6 routing-table [ vpn-instance vpn-instance-name ] [ verbose ] [ standby slot slot-number ]

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 ] [ standby slot slot-number ]

Display information about routes permitted by an IPv6 basic ACL.

display ipv6 routing-table [ vpn-instance vpn-instance-name ] acl acl6-number [ verbose ] [ standby slot slot-number ]

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 ] [ standby slot slot-number ]

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 ] [ standby slot slot-number ]

Display information about routes installed by an IPv6 protocol.

display ipv6 routing-table [ vpn-instance vpn-instance-name ] protocol protocol [ inactive | verbose ] [ standby slot slot-number ]

Display IPv6 route statistics.

display ipv6 routing-table [ vpn-instance vpn-instance-name ] statistics [ standby slot slot-number ]

Display brief IPv6 routing table information.

display ipv6 routing-table [ vpn-instance vpn-instance-name ] summary [ standby slot slot-number ]

Display route attribute information in the IPv6 RIB.

display ipv6 rib attribute [ attribute-id ] [ standby slot slot-number ]

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 ] [ standby slot slot-number ]

display ipv6 rib nib protocol protocol-name [ verbose ] [ standby slot slot-number ]

Display next hop information for IPv6 direct routes.

display ipv6 route-direct nib [ nib-id ] [ verbose ]

Clear IPv6 route statistics.

reset ipv6 routing-table statistics protocol [ vpn-instance vpn-instance-name ] { protocol | all } [ standby slot slot-number ]

 

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网