02-19-2021 08:59 AM
First time poster here. Hoping to benefit from your insight.
I have a test environment with a hub and spoke architecture using OSPF as the routing protocol. Each spoke and the hub connect to each other over two simulated service provider WANs with the traffic being load balanced over the two.
What I want to be able to do is to set the cost of routes being learned by the hub from only one location over a specific interface to a higher cost without changing/ impacting the routing from the hub standpoint to other locations. The config below is how I have sought to do this. However, the routes are still being installed on the hub router with the default costs. I'm testing this in GNS3 using the C7200 image.
What am I missing?
R2#show run | sec route-map
route-map INCREASE permit 10
match ip address prefix-list MYNET
match interface GigabitEthernet2/0
set metric 100
route-map INCREASE permit 20
R2#show ip prefix-list
ip prefix-list MYNET: 1 entries
seq 5 permit 22.214.171.124/32
R2#show run | sec router
router ospf 10
network 192.168.11.0 0.0.0.255 area 0
network 192.168.12.0 0.0.0.255 area 0
network 192.168.100.0 0.0.0.255 area 0
distribute-list route-map INCREASE in
R2#show ip route
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, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
C 192.168.11.0/24 is directly connected, GigabitEthernet2/0
L 192.168.11.4/32 is directly connected, GigabitEthernet2/0
C 192.168.12.0/24 is directly connected, GigabitEthernet1/0
L 192.168.12.4/32 is directly connected, GigabitEthernet1/0
O 126.96.36.199 [110/2] via 192.168.12.3, 00:00:02, GigabitEthernet1/0
[110/2] via 192.168.11.3, 01:01:31, GigabitEthernet2/0<---- the route I want to modifiy
192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.100.0/24 is directly connected, GigabitEthernet3/0
L 192.168.100.2/32 is directly connected, GigabitEthernet3/0
Solved! Go to Solution.
02-20-2021 12:27 PM
PBR you can use the following to check the availibility of next/hop if next hop is not reachable standard destination routing is used
set ip next-hop address
set ip next-hop verify-availability
Hope to help
02-19-2021 11:14 AM
Can you draw the topology
02-19-2021 12:08 PM
02-19-2021 03:59 PM
I was able to increase the cost of the route in my test lab using all the same configurations you used. It is also strange that the routing table on R2 shows the network 188.8.131.52 without the CIDR. Can you please provide the output from the following command on R2?
show ip ospf rib
02-19-2021 04:13 PM
I try and also same result couldn't change Cost for specific prefix,
I use GNS3 use image 7200.
which image you use ?
02-19-2021 09:35 PM
I used the same image as you did, 7200.
02-19-2021 09:33 PM
Could it be a bug within GNS 3?
Here's the output of the command requested below.
Base Topology (MTID 0)
OSPF local RIB
Codes: * - Best, > - Installed in global RIB
* 192.168.11.0/24, Intra, cost 1, area 0, Connected
via 192.168.11.4, GigabitEthernet2/0
* 192.168.12.0/24, Intra, cost 1, area 0, Connected
via 192.168.12.4, GigabitEthernet1/0
*> 184.108.40.206/32, Intra, cost 2, area 0
via 192.168.12.3, GigabitEthernet1/0
via 192.168.11.3, GigabitEthernet2/0
* 192.168.100.0/24, Intra, cost 1, area 0, Connected
via 192.168.100.2, GigabitEthernet3/0
02-19-2021 05:06 PM
try the following:
clear ip ospf proc
However, OSPF is a link state protocol so the changes are not effective on the LSA and they are local to the node where the distribution list is configured
Hope to help
02-19-2021 09:43 PM
I tried clearing the ospf process before but unfortunately it didn't work. I am also aware that the change will not propagate to neighbouring routers. Thanks for the reminder.
02-20-2021 02:10 AM
Hello @vaughanreese_jones ,
in a real world network I would use PBR to achieve the desired result instead of attempting to tweak OSPF that is not so easy for its link state nature.
Hope to help
02-20-2021 08:16 AM
I thought about that. My issue though is that if the link goes down there wouldn't be a dynamic which over to the available link.
This is why I want to adjust the cost so that in the even of failure it will dynamically use the next available route.