Modify the Redistributed Routes Metric by using Route-Map

Tags

, , , , ,

There are times, when you want to advertise a different metric than the normal EIGRP and RIP redistributed metric of 20 to OSPF, a option for that is using the popular Route Map.

See below, I want to redistribute the specific routes that I will match by an access-list 1 with a metric of 200 and the rest of the routes will use another metric, a metric of 100.

conf t 

router ospf 1 

redistribute eigrp 1 subnets route-map METRIC  

exit 

!

access-list 1 permit 10.1.1.0 0.0.0.255 

access-list 1 permit 172.16.1.0 0.0.0.3 

access-list 1 permit 192.168.1.1 0.0.0.0 

exit 

!

route-map METRIC permit 10 

match ip address 1 

set metric 200 

exit 

!

route-map METRIC permit 20 

set metric 100 

end

!

So, this way, my matched routes, (classless routes) will be redistributed to OSPF with a metric of 200 and my unmatched routes, (classful routes) with a metric of 100.

OSPF Virtual Link

Tags

, , , , , , ,

In today’s networks and specifically in OSPF it is required that all Areas to be connected to the Backbone Area 0, so this way it’s contiguous and OSPF working properly exchanging routes and getting routes. But there might be cases when it’s not possible to connect another Area, as in this example, Area 2, to the Backbone Area 0, here OSPF Virtual Link comes into help. This work around it’s not really recommended, and we can do this for a short period of time, until we design our OSPF network properly to be contiguous, all areas to connect to Area 0.

Right, with that in mind, we can connect a Router that is non-connected to the backbone Area 0 by using Virtual Link.

Have a look at the topology below, focus on R1 (ASBR) and R2 (ABR), we’ve got a link on R1 with the IP of 10.2.2.1/32 that sits in Area 2, well, normally this network is not seen by R2 ABR and not advertised by R1 ASBR, because it’s in the Area 2, and is not directly connected to the Backbone Area 0. As well as the Loopback with the IP Address of 1.1.1.1/32 is not seen by R2 ABR.

rsz_1screenshot_73.png

OK, let’s make these guys 10.2.2.1/32 and 1.1.1.1/32 on R1 ASBR that stays in Area 2 talk to R2 ABR which have a link in Area 1 and another in Area 0. Here’s the configuration:

R1 ASBR:

conf t

router ospf 1

area 1 virtual-link 172.17.3.1

end

!

R2 ABR:

conf t

router ospf 1

area 1 virtual-link 172.18.3.1

end

!

Alright, all done, notice that I’ve used “area 1” in both routers, because this is the area that interconnects them, and I’ve also used “virtual-link 172.17.3.1” on R1 and “virtual-link 172.18.3.1” on R2 because these are the router ID’s, they have chosen the highest Loopback IP Address as their OSPF router-id.

Now let’s look what R2 ABR and R1 ASBR says, do they have connection over the virtual link we created, does R2 ABR learns about the R1 ASBR routes of 10.2.2.1/32 and 1.1.1.1/32 ? Let’s find out.

I’m on R2, he says the following:

R2#sh ip ospf v
Virtual Link OSPF_VL2 to router 172.18.3.1 is up
Run as demand circuit
DoNotAge LSA allowed.
Transit area 1, via interface FastEthernet2/0
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:08
Adjacency State FULL (Hello suppressed)
Index 3/4, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec

R2 also says that he’s got a neighbor that is connect through a Point-to-Point link to him with the Router ID of 172.18.3.1, which is R1, the ASBR. And below is the proof:

R2#sh ip ospf ne

Neighbor ID Pri State Dead Time Address Interface
172.18.3.1 0 FULL/ – – 10.0.0.1 OSPF_VL2
172.16.2.1 0 FULL/ – 00:00:35 192.168.0.6 Serial4/0
172.16.1.1 0 FULL/ – 00:00:38 192.168.0.2 Serial4/1
172.18.3.1 1 FULL/DR 00:00:30 10.0.0.1 FastEthernet2/0

And R2 claims as well that he learned now about R1’s networks or links (10.2.2.1/32 and 1.1.1.1/32:

R2#sh ip ro ospf
Codes: L – local, 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, + – replicated route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/2] via 10.0.0.1, 00:32:30, FastEthernet2/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/1001] via 192.168.0.2, 00:39:05, Serial4/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/1001] via 192.168.0.6, 00:39:05, Serial4/0
5.0.0.0/32 is subnetted, 1 subnets
O E2 5.5.5.5 [110/20] via 10.0.0.1, 00:39:05, FastEthernet2/0
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O IA 10.2.2.1/32 [110/2] via 10.0.0.1, 00:32:30, FastEthernet2/0
172.16.0.0/32 is subnetted, 2 subnets
O 172.16.1.1 [110/1001] via 192.168.0.2, 00:39:05, Serial4/1
O 172.16.2.1 [110/1001] via 192.168.0.6, 00:39:05, Serial4/0
172.17.0.0/16 is variably subnetted, 9 subnets, 3 masks
O 172.17.0.0/22 is a summary, 00:39:07, Null0
172.18.0.0/22 is subnetted, 1 subnets
O E2 172.18.0.0 [110/20] via 10.0.0.1, 00:39:07, FastEthernet2/0
192.168.0.0/24 is variably subnetted, 5 subnets, 2 masks
O 192.168.0.8/30 [110/1064] via 192.168.0.6, 00:39:07, Serial4/0
[110/1064] via 192.168.0.2, 00:39:07, Serial4/1
O 192.168.1.0/24 [110/2] via 10.0.0.1, 00:39:07, FastEthernet2/0

And of course there is connection between these guys, R2 that sits in Area 0 and Area 1 that is connecting to R1, that has it’s link in area 1 with R2 and the loopbacks with 10.2.2.1/32 and 1.1.1.1/32 that are in area 2, which is not directly connected to the backbone area 0, but through a virtual-link.

R2#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/23/40 ms
R2#ping 10.2.2.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/15/32 ms

EIGRP Equal Cost and Unequal Cost + Successor and Feasible Successor

Tags

, , , , , ,

EIGRP can do load balancing over equal or unequal cost paths.

Equal Cost is when we have multiple paths with the same metric to a destination.

Unequal Cost is when we have different paths with not the same metric to a destination.

In Equal Cost path we can manually configure up to how many paths we can load balance across. This can be done like this:

conf t

router eigrp 1

maximum-paths 4 (which is the default actually)

end

!

Now when we do show ip protocols, we see:

R1#sh ip pro
*** IP Routing is NSF aware ***

Routing Protocol is “eigrp 1”
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
Redistributing: eigrp 1
EIGRP-IPv4 Protocol for AS(1)
Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
NSF-aware route hold timer is 240
Router-ID: 209.165.201.1
Topology : 0 (base)
Active Timer: 3 min
Distance: internal 90 external 170
Maximum path: 4
Maximum hopcount 100
Maximum metric variance 1

So if we got 4 Equal Cost paths to a destination, we will load balance across them all.

In Unequal Cost we have different paths with different metric to a destination, and if let’s say we want to load balance across them, we’ll definitely need the variance feature to come into play here.

Let’s say we got the below topology:

igrp

We are sitting on Router E and we got these unequal cost paths to the destination of Net X. Ok, in our case Router E will install a Successor Route through Router C because of the lowest cost of 20, lower than the other paths, and the Feassible Successor Route through Router B because of cost of 30, the lower than the path through Router D, which has a cost of 45.

Let’s say now that we want to load balance acros these 2 paths, we don’t want to send our traffic to the destination of Network X through Router C only, we want to send our traffic through Router B also, we want to share the traffic through these 2 Routers, Router B and Router C. By default the above mentioned variance have a value of 1 which means, there are no load balancing possibility with that value of 1. See below the output of the “show ip protocols” command again for reference:

R1#sh ip pro
*** IP Routing is NSF aware ***

Routing Protocol is “eigrp 1”
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
Redistributing: eigrp 1
EIGRP-IPv4 Protocol for AS(1)
Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
NSF-aware route hold timer is 240
Router-ID: 209.165.201.1
Topology : 0 (base)
Active Timer: 3 min
Distance: internal 90 external 170
Maximum path: 4
Maximum hopcount 100
Maximum metric variance 1

Fair enough, we cannot send our traffic to Network X through Router B also at the same time that we send through Router C, unless we change the variance.

We can figure out what value we need to put in Router E in order to send our traffic through Router C also, so, to calculate the right variance value for that, we take the Successor Cost to Network X, which is 20, and we multiply it by 2, not by 1, as it is by default, because by 1 it gives us the same thing of 20, which does not satisfy us. Let’s multiply our Successor Cost then by 2, which is 40 (20*2=40), this is better, because our path through Router B is 30, this means that is less that what we came up with, the number of 40, so, now our traffic can be load balanced across Router B and Router C almost equally. Below is the command to set the variance to 2:

conf t

router eigrp 1

variance 2

end

!
As we can see below, the variance value have changed:
R1#sh ip pro
*** IP Routing is NSF aware ***

Routing Protocol is “eigrp 1”
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
Redistributing: eigrp 1
EIGRP-IPv4 Protocol for AS(1)
Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
NSF-aware route hold timer is 240
Router-ID: 209.165.201.1
Topology : 0 (base)
Active Timer: 3 min
Distance: internal 90 external 170
Maximum path: 4
Maximum hopcount 100
Maximum metric variance 2

This means that any route that meets the Feasibility Condition, that is either Successor or Feasible Successor will be taken into consideration for load balance, of course if our variance value is properly configured.

A Feasible Successor Route can be installed in the EIGRP topology table only if it meets this Feasibility Condition, which states that the Reported Distance (RD) of a route needs to be lower than the actual Feasible Distance (FD) of the Successor Route. So, in other words, the reported distance that you reported to me to reach a network, should be less than my current total distance to reach that network.

A Successor Route is the best rout to a destination that includes the lowest Advertised Distance (AD) of the neighbour router to me, plus the my distance to reach that neighbour that advertised me the route.

So, let’s say I got 2 routers to go through to reach a destination, I’m on R1, my closest neighbour is R2 and he is connected to R3. R2 tells me that he’s got a metric of 10 to reach my destination, I add my metric to reach R2, which is 10 and come up with a metric of 20.

Route Poisoning and Hold Down Timer

Tags

,

In RIP terms, a 16th hop is infinite (unreachable) since RIP uses how count as its metric and the maximum hop is 15, so automatically 16th becomes infinite.

Route Poisoning it’s a loop prevention mechanism, similar to Split Horizon, Route Tagging and Route Filtering. Imagine I got 3 routers in a row, from left to right is R1, R2, R3. The link between R2 and R1 fails and R2 sends a RIP update to R3 claiming the network between R2 and R1 to be dead and here comes our term in use, route poisoning, because R2 poisons its route that he had between itself and R1 when it sends the update to R3, it tells him:

“Hey R3, you know the 192.168.1.0/24 route I sent you time ago, now is dead, the hop to reach this route is 16, so, I wouldn’t advice you go through me to reach that route.”

When R3 got this update, it says: “OK, no problem R2” and starts the Hold Down Timer which by default is 180 seconds, during this timer R3 does not allow any updates from any router about that dead route of 192.168.1.0/24. The only update R3 allows for that failed route, is the update coming from the router that originated this update, R2 in our case. If R3 does not receive any news in 180 seconds since he got the update from R2 about 192.168.1.0/24 dead route, R3 removes the route from its routing table. So this way, R2 prevented R3 not to send anything to that route of 192.168.1.0/24 because it’s dead.