04-Network Connectivity

HomeSupportResource CenterH3C Access Points Cloud Mode Configuration Guides(E2442 R2442)-6W10004-Network Connectivity
20-Basic IP routing configuration
Title Size Download
20-Basic IP routing configuration 70.82 KB

Configuring basic IP routing

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 and route redistribution 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.

Route categories

Table 1 categorizes routes by different criteria.

Table 1 Route categories

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.

 

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 2 Route types and default route preferences

Route type

Preference

Direct route

0

Multicast static route

1

Unicast static route

60

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 and IPv6 static routing 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 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.

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.

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

Setting the maximum lifetime for routes in the FIB

About this task

FIB entries must be retained for some time after a protocol process switchover or RIB process switchover to avoid routing issues. Perform this task to adjust the maximum lifetime for route entries in the FIB.

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.

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 [ 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 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 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 [ 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 an IPv6 destination address.

display ipv6 routing-table ipv6-address [ prefix-length ] [ longer-match ] [ 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 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 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 }

Clear IPv6 route statistics.

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