The primary functions of a router are to determine the best path to forward packets based on the information in its routing table, and to forward packets toward their destination.
The router uses its IP routing table to determine which path (route) to use to forward a packet. R1 and R2 will use their respective IP routing tables to first determine the best path, and then forward the packet.
The primary functions of a router are to determine the best path to forward packets based on the information in its routing table, and to forward packets toward their destination.
The router uses its IP routing table to determine which path (route) to use to forward a packet. R1 and R2 will use their respective IP routing tables to first determine the best path, and then forward the packet.
Directly Connected Networks: Added to the routing table when a local interface is configured with an IP address and subnet mask (prefix length) and is active (up and up).
Remote Networks: Networks that are not directly connected to the router. Routers learn about remote networks in two ways:
Default Route: Specifies a next-hop router to use when the routing table does not contain a specific route that matches the destination IP address. The default route can be entered manually as a static route, or learned automatically from a dynamic routing protocol.
Forward the Packet to a Device on a Directly Connected Network ( IF No match ! )
Known Destination :Forward the Packet to a Next-Hop Router (IF No Match ! )
Unknown Destination (0.0.0.0) Forward the Packet to a Next-Hop Router (IF No Match ! )
Drop the Packet – No Match in Routing Table
A routing table contains a list of routes to known networks (prefixes and prefix lengths). The source of this information is derived from the following:
The source for each route in the routing table is identified by a code. Common codes include the following:
To learn about any remote networks, the router must have at least one active interface configured with an IP address and subnet mask (prefix length). This is known as a directly connected network or a directly connected route. Routers add a directly connected route to its routing table when an interface is configured with an IP address and is activated.
Static routing has three primary uses:
Dynamic routing protocols are used by routers to automatically share information about the reachability and status of remote networks.
Dynamic routing protocols perform several activities, including network discovery and maintaining routing tables.
The default route specifies a next-hop router to use when the routing table does not contain a specific route that matches the destination IP address.
A default route can be either a static route or learned automatically from a dynamic routing protocol. A default route has an IPv4 route entry of 0.0.0.0/0 or an IPv6 route entry of ::/0. This means that zero or no bits need to match between the destination IP address and the default route.
A routing protocol is a set of processes, algorithms, and messages that are used to exchange routing information and populate the routing table with the choice of best paths. The purpose of dynamic routing protocols includes the following:
The best path is selected by a routing protocol based on the value or metric it uses to determine the distance to reach a network. A metric is the quantitative value used to measure the distance to a given network. The best path to a network is the path with the lowest metric.
When a router has two or more paths to a destination with equal cost metrics, then the router forwards the packets using both paths equally. This is called equal cost load balancing.
Note: Only EIGRP supports unequal cost load balancing
IPv4 Next-Hop Static Route
R1(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.2
R1(config)# ip route 192.168.1.0 255.255.255.0 172.16.2.2
R1(config)# ip route 192.168.2.0 255.255.255.0 172.16.2.2
R1(config)# ip route 172.16.1.0 255.255.255.0 s0/1/0
R1(config)# ip route 192.168.1.0 255.255.255.0 s0/1/0
R1(config)# ip route 192.168.2.0 255.255.255.0 s0/1/0