Determine How a Router Makes a Forwarding Decision
Last Updated :
28 Nov, 2022
Pre-requisites: EIGRP, OSPF, Static Routing, AD value.
Static routing is a routing protocol that helps to keep your network organized and to optimize routing performance. It enables the router to assign a specific path to each network segment and to keep track of network changes. This helps to improve network stability and continuity. This adds security because a single administrator can only authorize routing to particular networks.
We are going to see how a router selects the best path for a packet, which is decided based on:
- Longest Prefix
- Lowest AD value
- Lowest Metric value
Configuration:
Consider the topology:
In this Topology:
- R1 has a static route towards R2 for R6’s loopback interface and R2 and R6 are exchanging routers using EIGRP 100
- R1, R3, and R6 are exchanging networks using EIGRP 12345
- R1, R4, and R6 are exchanging networks using EIGRP 23
- R1, R5, and R6 are exchanging networks using OSPF.
We are going to ping R6’s loopback from R1 and check the packet’s path. First, we need to do some configuration:
R1’s Configuration:
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.252
no shutdown
interface FastEthernet1/0
ip address 10.0.1.1 255.255.255.252
no shutdown
interface FastEthernet2/0
ip address 10.0.2.1 255.255.255.252
no shutdown
interface FastEthernet2/1
ip address 10.0.3.1 255.255.255.252
no shutdown
router eigrp 12345
network 10.0.1.0 0.0.0.3
router eigrp 23
network 10.0.2.0 0.0.0.3
router ospf 100
network 10.0.3.0 0.0.0.3 area 0
ip route 1.1.1.1 0.0.0.0 f0/0
R2’s Configuration:
interface FastEthernet0/0
ip address 10.0.0.2 255.255.255.252
no shutdown
interface FastEthernet1/0
ip address 20.0.0.1 255.255.255.252
no shutdown
router eigrp 100
network 0.0.0.0
passive-interface FastEthernet0/0
R3’s Configuration:
interface FastEthernet0/0
ip address 20.0.1.1 255.255.255.252
no shutdown
interface FastEthernet1/0
ip address 10.0.1.2 255.255.255.252
no shutdown
router eigrp 12345
network 0.0.0.0
R4’s Configuration:
interface FastEthernet2/0
ip address 10.0.2.2 255.255.255.252
no shutdown
interface FastEthernet2/1
bandwidth 1000
ip address 20.0.2.1 255.255.255.252
no shutdown
router eigrp 23
network 0.0.0.0
R5’s Configuration:
interface FastEthernet2/0
ip address 20.0.3.1 255.255.255.252
no shutdown
interface FastEthernet2/1
ip address 10.0.3.2 255.255.255.252
no shutdown
router ospf 100
network 0.0.0.0 255.255.255.255 area 0
R6’s Configuration:
interface Loopback1
ip address 1.1.1.1 255.255.255.255
interface FastEthernet0/0
ip address 20.0.1.2 255.255.255.252
no shutdown
interface FastEthernet1/0
ip address 20.0.0.2 255.255.255.252
no shutdown
interface FastEthernet2/0
ip address 20.0.3.2 255.255.255.252
no shutdown
interface FastEthernet2/1
ip address 20.0.2.2 255.255.255.252
no shutdown
router eigrp 100
network 1.1.1.1 0.0.0.0
network 20.0.0.0 0.0.0.3
no auto-summary
router eigrp 12345
network 1.1.1.1 0.0.0.0
network 20.0.1.0 0.0.0.3
no auto-summary
router eigrp 23
network 1.1.1.1 0.0.0.0
network 20.0.2.0 0.0.0.3
no auto-summary
router ospf 100
network 1.1.1.1 0.0.0.0 area 0
network 20.0.3.0 0.0.0.3 area 0
To check which path the packet is following we are going to use traceroute, but first, let’s check R1’s routing table:
As you can see for 1.1.1.1 we only have one route right now because the routing table only stores the best route.
Traceroute:
traceroute 1.1.1.1
Right now, the packet is going through R1→R2→R6 which is the best route with the longest prefix match.
We have now shut down R1’s f0/0 interface:
int f0/0
shutdown
Now we traceroute:
Now the packet is following the path R1→R3→R6 because EIGRP has a lower AD value than OSPF and the EIGRP path through R1→R4→R6 has a higher metric value (increased it by lowering R4 f2/1 interface bandwidth).
We are currently shutting down R1’s f1/0 interface:
int f1/0
shutdown
Now we traceroute again:
Now the packet is following the path R1→R4→R6 because EIGRP has a lower AD value than OSPF.
We have now shut down R1’s f2/0 interface:
int f2/0
shutdown
Now we traceroute again:
Now R1→R5→R6 is the path left for R1 to reach R6’s loopback.
Share your thoughts in the comments
Please Login to comment...