The router uses the routing table to determine where to send packets. When a packet is received, it compares the destination IP address contained in the packet with all known routes in the routing table.
Use the show ip route command to view the routing table. A sample output of this command is shown below.
Router1841#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 192.168.2.1 to network 0.0.0.0
R 172.16.0.0/16 [120/1] via 192.168.1.1, 00:00:08, FastEthernet0/0
R 172.17.0.0/16 [120/2] via 192.168.1.1, 00:00:08, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, FastEthernet0/1
S* 0.0.0.0 [1/0] via 192.168.2.1
The following table describes important information shown in the command output:
Component |
Description |
Gateway of last resort |
The gateway of last resort identifies a route to use if the packet does not match any other route. In this example, the route of 0.0.0.0 with a mask of 0.0.0.0 matches every packet. If the destination IP address does not match any other route, the next hop address of 192.168.2.1 is used for this packet. Note: If the output shows the line Gateway of last resort is not set, then the router can only send packets to the specific routes listed in the routing table. Packets that do not match a specific route will be dropped. |
Route type |
The first characters of a routing table entry identifies the source or type of the route.
A route marked with * indicates a route that is a candidate for the default route. The router uses this route to determine whether the route can be used to set the gateway of last resort information. If it meets several conditions, the information in the route marked with * is used for the gateway of last resort information. |
Network |
Following the route type is the network address and subnet mask. This identifies the specific subnet address for the route. |
Administrative distance and cost |
The numbers in brackets following non-connected routes identify the following two items:
Note: Be aware that the administrative distance is used to select a route learned between different protocols, while the cost is used to select the best route learned by the same protocol. |
Next hop router |
The address indicated by via identifies the router address where packets will be sent when sending to the destination network. The next hop router address is a router on the same subnet as a directly connected interface. However, this does not mean that the next hop router is connected directly to the destination network, but rather that it is the next stop in the path to the destination. |
Last update |
For routes learned through a routing protocol, the time value (such as 00:00:08) indicates the elapsed time since the last update about the route was received. Most protocols periodically send information about known routes. The update time helps you to know the age of the route information. |
Out interface |
The interface designation at the end of the route identifies the local router interface used to reach the next hop router and therefore to reach the destination network. |
Be aware of the following:
Credit: Testout 640-802 CCNA Notes
ไม่มีความเห็น