forwarded out the correct interface or to the appropriate gateway. If the network address matchesmore than one route in the routing table, the router uses the route that has the most specific, or longest, network address match.Sometimes there is more than one route to the destination network. In this case, routing protocolrules determine which route the router uses.If none of the route entries match, the router directs the message to the gateway specified by itsdefault route, if a default route is configured. Otherwise, the packet is simply dropped.
6.1.1 - Routing Basics
The diagram depicts a network, and shows the following three processes used to determine the patha packet takes to get to its destination: applies subnet mask, examines routing table, and forwards packets.The following information is used for all processes:Gateway of last resort is 172.16.3.1 to network 0.0.0.0S172.17.0.0 /16 [1 /0] via 172.16.3.117220.127.116.11 /16 is variably subnetted, 4 subnets, 2 masksS172.16.236.0 /24 -1 /0= via 172.16.3.1S 172.16.0.0 /16 [1 /0] via 172.16.3.1C 172.16.1.0 /24 is directly connected, FastEthernet0 /0C 172.16.3.0 /24 is directly connected, FastEthernet0 /1172.22.0.0/24 is subnetted, 1 subnetsS 172.22.1.0 [1 /0] via 172.16.1.1S* 0.0.0.0 /0 [1 /0] via 172.16.3.1Process 1 - Applies Subnet Mask Router applies each subnet mask to the destination IP address to find the network address with thelongest match.172.16.236.101 longest match: 172.16.236.0 255.25.255.0Process 2 - Examines Routing TableRouter compares the resulting network address to the routing table entries.S 172.16.236.0 /24 [1 /0] via 172.16.3.1Process 3 - Forwards PacketRouter sends the packet out the correct interface to reach the next-hop address for the destinationnetwork.C 18.104.22.168 /24 is directly connected, FastEthernet0 /1
On a Cisco router, the Cisco IOS command
show ip route
displays the routes in the routing table.Several types of routes can appear in the routing table.