01-IP Routing Overview
Chapters Download (64.79 KB)
Go to these sections for information you are interested in:
l IP Routing and Routing Table
l Displaying and Maintaining a Routing Table
The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.
Routing in the Internet is achieved through routers. Upon receiving a packet, a router finds an optimal route based on the destination address and forwards the packet to the next router in the path until the packet reaches the last router, which forwards the packet to the intended destination host.
Routing tables play a key role in routing. Each router maintains a routing table, and each entry in the table specifies which physical interface a packet destined for a certain destination should go out to reach the next hop (the next router) or the directly connected destination.
Routes in a routing table can be divided into three categories by origin:
l Direct routes: Routes discovered by data link protocols, also known as interface routes.
l Static routes: Routes that are manually configured.
l Dynamic routes: Routes that are discovered dynamically by routing protocols.
A routing table includes the following key items:
l Destination address: Destination IP address or destination network.
l Network mask: Specifies, in company with the destination address, the address of the destination network. A logical AND operation between the destination address and the network mask yields the address of the destination network. For example, if the destination address is 129.102.8.10 and the mask 255.255.0.0, the address of the destination network is 129.102.0.0. A network mask is made of a certain number of consecutive 1s. It can be expressed in dotted decimal format or by the number of the 1s.
l Outbound interface: Specifies the interface through which the IP packets are to be forwarded.
l IP address of the next hop: Specifies the address of the next router on the path. If only the outbound interface is configured, its address will be the IP address of the next hop.
l Priority for the route. Routes to the same destination but having different nexthops may have different priorities and be found by various routing protocols or manually configured. The optimal route is the one with the highest priority (with the smallest metric).
Routes can be divided into two categories by destination:
l Subnet routes: The destination is a subnet.
l Host routes: The destination is a host.
Based on whether the destination is directly connected to a given router, routes can be divided into:
l Direct routes: The destination is directly connected to the router.
l Indirect routes: The destination is not directly connected to the router.
To prevent the routing table from getting too large, you can configure a default route. All packets without matching any entry in the routing table will be forwarded through the default route.
In Figure 1-1, the IP address on each cloud represents the address of the network. Router G is connected to three networks and therefore has three IP addresses for its three physical interfaces. Its routing table is shown under the network topology.
Figure 1-1 A sample routing table
Destination Network |
Nexthop |
Interface |
11.0.0.0 |
11.0.0.1 |
2 |
12.0.0.0 |
12.0.0.1 |
1 |
13.0.0.0 |
12.0.0.2 |
1 |
14.0.0.0 |
14.0.0.4 |
3 |
15.0.0.0 |
14.0.0.2 |
3 |
16.0.0.0 |
14.0.0.2 |
3 |
17.0.0.0 |
11.0.0.2 |
2 |
To do… |
Use the command… |
Remarks |
Display brief information about the active routes in the routing table |
display ip routing-table [ verbose | | { begin | exclude | include } regular-expression ] |
Available in any view |
Display information about routes to the specified destination |
display ip routing-table ip-address [ mask-length | mask ] [ longer-match ] [ verbose ] |
Available in any view |
Display information about routes with destination addresses in the specified range |
display ip routing-table ip-address1 { mask-length | mask } ip-address2 { mask-length | mask } [ verbose ] |
Available in any view |
Display information about routes permitted by an IPv4 basic ACL |
display ip routing-table acl acl-number [ verbose ] |
Available in any view |
Display routing information permitted by an IPv4 prefix list |
display ip routing-table ip-prefix ip-prefix-name [ verbose ] |
Available in any view |
Display routes of a routing protocol |
display ip routing-table protocol protocol [ inactive | verbose ] |
Available in any view |
Display statistics about the routing table |
display ip routing-table statistics |
Available in any view |
Clear statistics for the routing table |
reset ip routing-table statistics protocol { all | protocol } |
Available in user view |