Routing is the process that routesrs use to determine the path that IP packets should take over a network to reach their destination. Routers store routes to all of their known destinations in a routing table. When routers receibe packets, they look in the routing table to find the best route to forward that packet.
There are two main routing methods:
Dynamic Routing: routers use dynamic routing protocols (i.e. OSPF) to share routing information with each other automatically and build their routing tables.
Static Routing: a network engineer/admin manually configures routes on the router
A route tells the router to:
next-hop
= the next router in the path to the destinationFor simplicity we’ll only show R1’s config.
show ip route
to view routing table 🔥192.168.1.1/24
192.168.1.0/24
G0/2
”/32
netmask is used to specify the exact IP address of the interface192.168.1.1/24
, the local route is 192.168.1.1/32
A packet destined for 192.168.1.1 is matched by 2 routes in the example above:
192.168.1.0/24
192.168.1.1/32
It will choose the most specific matching route.