- Table of Contents
-
- 04-Layer 3 Configuration Guide
- 00-Preface
- 01-Basic IP Routing Configuration
- 02-Static Routing Configuration
- 03-IPv6 Static Routing Configuration
- 04-IP Addressing Configuration
- 05-IPv6 Basics Configuration
- 06-DHCP Configuration
- 07-DHCPv6 Configuration
- 08-DNS Configuration
- 09-IPv6 DNS Configuration
- 10-IP Performance Optimization Configuration
- 11-ARP Configuration
- 12-IP Forwarding Basics Configuration
- 13-NAT Configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
01-Basic IP Routing Configuration | 82.84 KB |
The term "router" in this document refers to both routers and access points.
IP routing directs IP packet forwarding on routers based on a routing table. This book focuses on unicast routing protocols. For more information about multicast routing protocols, see IP Multicast Configuration Guide.
Routing table
A router maintains at least two routing tables: a global routing table and a FIB. The FIB table contains only the optimal routes, and the global routing table contains all routes. The router uses the FIB table to forward packets. For more information about the FIB table, see Layer 3 Configuration Guide.
Table 1 categorizes routes by different criteria.
Criterion |
Categories |
Destination |
· Network route—Destination is a network. The subnet mask is less than 32 bits. · Host route—Destination is a host. The subnet mask is 32 bits. |
Whether the destination is directly connected |
· Direct route—Destination is directly connected. · Indirect route—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
Routing Tables:
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.0/24 Direct 0 0 1.1.1.1 Vlan1
2.2.2.0/24 Static 60 0 12.2.2.2 Vlan2
80.1.1.0/24 Static 60 0 80.1.1.1 Vlan3
…
A route entry includes the following key items:
· Destination—IP address of the destination host or network.
· Mask—Mask length of the IP address.
· Pre—Preference of the route. Among routes to the same destination, the one with the highest preference is optimal.
· Cost—If multiple routes to a destination have the same preference, the one with the smallest cost becomes the optimal route.
· NextHop—Next hop.
· Interface—Output interface.
Route preference
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 as required. 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 |
Static route |
60 |
Unknown (route from an untrusted source) |
256 |
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.
Displaying and maintaining a routing table
Task |
Command |
Remarks |
Display routing table information. |
display ip routing-table [ verbose ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display IPv6 routing table information. |
display ipv6 routing-table [ verbose ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |