05-Layer 3—IP Routing Configuration Guide

HomeSupportSwitchesS5150 SeriesConfigure & DeployConfiguration GuidesH3C S5150-EI Switch Series Configuration Guides-Release 510x-6W10205-Layer 3—IP Routing Configuration Guide
01-Basic IP routing configuration
Title Size Download
01-Basic IP routing configuration 86.05 KB

Configuring basic IP routing

IP routing directs IP packet forwarding on routers based on a routing table.

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

 

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

<Sysname> display ip routing-table

 

Destinations : 9        Routes : 9

 

Destination/Mask   Proto   Pre Cost        NextHop         Interface

0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0

3.3.3.3/32         Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0

127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0

127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0

127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

...

A route entry includes the following key items:

·     Destination—IP address of the destination host or network.

·     Mask—Mask length of the IP address.

·     Proto—Protocol that installed the route.

·     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.

·     NextHop—Next hop.

·     Interface—Output 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

Routing algorithm

·     Distance-vector protocols—Examples include RIP.

·     Link-state protocols—Examples include OSPF.

IP version

·     IPv4 routing protocols—Examples include RIP and OSPF.

·     IPv6 routing protocols—Examples include RIPng and OSPFv3.

 

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

OSPF

10

Unicast static route

60

RIP

100

OSPF ASE

150

OSPF NSSA

150

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,  and OSPFv3 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 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.

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

Setting the maximum lifetime for routes 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 set the maximum lifetime for routes in the RIB (IPv4):

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

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

address-family ipv4

By default, no RIB IPv4 address family exists.

4.     Set the maximum lifetime for IPv4 routes in the RIB.

protocol protocol lifetime seconds

By default, the maximum lifetime for routes in the RIB is 480 seconds.

 

To set the maximum route lifetime for routes in the RIB (IPv6):

 

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

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

address-family ipv6

By default, no RIB IPv6 address family exists.

4.     Set the maximum lifetime for IPv6 routes in the RIB.

protocol protocol lifetime seconds

By default, the maximum lifetime for routes in the RIB is 480 seconds.

 

Setting 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 set 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 the RIB IPv4 address family and enter its view.

address-family ipv4

By default, no RIB IPv4 address family exists.

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.

 

To set 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 the RIB IPv6 address family and enter its view.

address-family ipv6

By default, no RIB IPv6 address family exists.

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

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 the RIB IPv4 address family and enter its view.

address-family ipv4

By default, no RIB IPv4 address family exists.

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 the RIB IPv6 address family and enter its view.

address-family ipv6

By default, no RIB IPv6 address family exists.

4.     Enable IPv6 RIB NSR.

non-stop-routing

By default, RIB NSR is disabled.

 

Configuring inter-protocol FRR

CAUTION

CAUTION:

This feature uses the next hop of a route from a different protocol as the backup next hop for the faulty route, which might cause loops.

 

Inter-protocol fast reroute (FRR) enables fast rerouting between routes of different protocols. A backup next hop is automatically selected to reduce the service interruption time caused by unreachable next hops. When the next hop of the primary link fails, the traffic is redirected to the backup next hop.

Among the routes to the same destination in the RIB, a router adds the route with the highest preference to the FIB table. For example, if a static route and an OSPF route in the RIB have the same destination, the router adds the OSPF route to the FIB table by default. The next hop of the static route is selected as the backup next hop for the OSPF route. When the next hop of the OSPF route is unreachable, the backup next hop is used.

Configuring IPv4 RIB inter-protocol FRR

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

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

address-family ipv4

By default, no RIB IPv4 address family exists.

4.     Enable IPv4 RIB inter-protocol FRR.

inter-protocol fast-reroute

By default, inter-protocol FRR is disabled.

 

Configuring IPv6 RIB inter-protocol FRR

Step

Command

Remarks

1.     Enter system view.

system-view

N/A

2.     Enter RIB view.

rib

N/A

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

address-family ipv6

By default, no RIB IPv6 address family exists.

4.     Enable IPv6 RIB inter-protocol FRR.

inter-protocol fast-reroute

By default, inter-protocol FRR is disabled.

 

Displaying and maintaining a routing table

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

 

Task

Command

Display routing table information.

display ip routing-table [ verbose ]

Display information about routes permitted by an IPv4 basic ACL.

display ip routing-table acl ipv4-acl-number [ verbose ]

Display information about routes to a specific destination address.

display ip routing-table ip-address [ mask-length | mask ] [ longer-match ] [ verbose ]

Display information about routes to a range of destination addresses.

display ip routing-table ip-address1 to ip-address2 [ verbose ]

Display information about routes permitted by an IP prefix list.

display ip routing-table prefix-list prefix-list-name [ verbose ]

Display information about routes installed by a protocol.

display ip routing-table protocol protocol [ inactive | verbose ]

Display IPv4 route statistics.

display ip routing-table statistics

Display brief IPv4 routing table information.

display ip routing-table summary

Display route attribute information in the RIB.

display rib attribute [ attribute-id ]

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 { protocol | all }

Display IPv6 routing table information.

display ipv6 routing-table [ verbose ]

Display information about routes to an IPv6 destination address.

display ipv6 routing-table ipv6-address [ prefix-length ] [ longer-match ] [ verbose ]

Display information about routes permitted by an IPv6 basic ACL.

display ipv6 routing-table acl ipv6-acl-number [ verbose ]

Display information about routes to a range of IPv6 destination addresses.

display ipv6 routing-table ipv6-address1 to ipv6-address2 [ verbose ]

Display information about routes permitted by an IPv6 prefix list.

display ipv6 routing-table prefix-list prefix-list-name [ verbose ]

Display information about routes installed by an IPv6 protocol.

display ipv6 routing-table protocol protocol [ inactive | verbose ]

Display IPv6 route statistics.

display ipv6 routing-table statistics

Display brief IPv6 routing table information.

display ipv6 routing-table summary

Display route attribute information in the IPv6 RIB.

display ipv6 rib attribute [ attribute-id ]

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 ]

Clear IPv6 route statistics.

reset ipv6 routing-table statistics protocol { protocol | all }

 

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Intelligent Storage
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
  • Technical Blogs
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
新华三官网