04-16-2018 04:53 PM - edited 03-08-2019 02:40 PM
Hello,
I've found the following OSPF configuration on my N9K,
router ospf MPLS
vrf MPLS
router-id 10.10.255.0
default-information originate
interface Vlan106
vrf member MPLS
ip address 10.10.254.2/24
ip ospf priority 110
ip router ospf MPLS area 0.0.0.2
interface loopback1
description OSPF ROUTER-ID MPLS
ip address 10.10.255.0/32
Why it has been used a loopback instead of using interface Vlan106 ip address ?
04-16-2018 05:11 PM
Hi
By best practices we always use a loopback as routing protocol router id.
If you don't set anything, default value will be the highest ip of loopback interfaces. If no loopbacks then highest ip of physical interfaces.
Anyway, you can use any ip of any interfaces you have on the device (loopbacks, SVI or physical).
04-16-2018 07:16 PM
Thanks Francesco,
can't understand the cost. On the other 9K I also have OSPF with another carrier which is actually a backup, OSPF configuration is the same except interfave vlan ip which is 10.10.254.3 and loopback which is 10.10.255.1. Which one will be preferred ?
04-16-2018 08:00 PM
You're talking about cost but at the same time you said the only differences are ip addresses.
You should have cost to differentiate the isp's links and make preferable compare to the other.
Can you share your config and show ip route from both Nexus switches and a quick drawing?
04-17-2018 05:40 AM - edited 04-17-2018 06:20 AM
Hi,
here it is ..
N9K01
vrf context MPLS
ip route 0.0.0.0/0 10.10.253.254
address-family ipv4 unicast
router ospf MPLS
vrf MPLS
router-id 10.10.255.0
default-information originate
interface Vlan105
vrf member MPLS
ip address 10.10.253.2/24
ip ospf priority 110
ip router ospf MPLS area 0.0.0.2
hsrp version 2
hsrp 105
preempt
ip 10.10.253.1
interface Vlan106
vrf member MPLS
ip address 10.10.254.2/24
ip ospf priority 110
ip router ospf MPLS area 0.0.0.2
interface loopback1
description OSPF ROUTER-ID MPLS
ip address 10.10.255.0/32
sh ip route ospf-MPLS vrf MPLS
7.28.132.32/32, ubest/mbest: 1/0
*via 10.10.254.253, Vlan106, [110/140], 1y24w, ospf-MPLS, type-1
7.27.17.121/32, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/41], 1y22w, ospf-MPLS, intra
10.10.32.0/24, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 10w2d, ospf-MPLS, type-1, tag 12874
10.10.34.0/23, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 10w2d, ospf-MPLS, type-1, tag 12874
10.10.36.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 10w2d, ospf-MPLS, type-1, tag 12874
10.10.44.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 10w2d, ospf-MPLS, type-1, tag 12874
10.10.48.0/24, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.50.0/23, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.52.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.56.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.60.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.244.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 28w6d, ospf-MPLS, type-1, tag 12874
10.10.251.0/24, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 28w6d, ospf-MPLS, type-1, tag 12874
10.10.252.0/24, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 28w6d, ospf-MPLS, type-1, tag 12874
192.168.100.12/30, ubest/mbest: 1/0
*via 10.10.254.253, Vlan106, [110/140], 1y13w, ospf-MPLS, type-1
N9K02
vrf context MPLS
ip route 0.0.0.0/0 10.10.253.254
address-family ipv4 unicast
router ospf MPLS
vrf MPLS
router-id 10.10.255.1
default-information originate
interface Vlan105
vrf member MPLS
ip address 10.10.253.3/24
ip ospf priority 90
ip router ospf MPLS area 0.0.0.2
hsrp version 2
hsrp 105
preempt
ip 10.10.253.1
interface Vlan106
vrf member MPLS
ip address 10.10.254.3/24
ip ospf priority 110
ip router ospf MPLS area 0.0.0.2
interface loopback1
description OSPF ROUTER-ID MPLS
ip address 10.10.255.1/32
sh ip route ospf-MPLS vrf MPLS
7.28.132.32/32, ubest/mbest: 1/0
*via 10.10.254.253, Vlan106, [110/140], 1y24w, ospf-MPLS, type-1
7.27.17.121/32, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/41], 1y22w, ospf-MPLS, intra
10.10.32.0/24, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 10w2d, ospf-MPLS, type-1, tag 12874
10.10.34.0/23, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 10w2d, ospf-MPLS, type-1, tag 12874
10.10.36.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 10w2d, ospf-MPLS, type-1, tag 12874
10.10.44.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 10w2d, ospf-MPLS, type-1, tag 12874
10.10.48.0/24, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.50.0/23, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.52.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.56.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.60.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 6w1d, ospf-MPLS, type-1, tag 12874
10.10.244.0/22, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 28w6d, ospf-MPLS, type-1, tag 12874
10.10.251.0/24, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 28w6d, ospf-MPLS, type-1, tag 12874
10.10.252.0/24, ubest/mbest: 1/0
*via 10.10.254.252, Vlan106, [110/90], 28w6d, ospf-MPLS, type-1, tag 12874
192.168.100.12/30, ubest/mbest: 1/0
*via 10.10.254.253, Vlan106, [110/140], 1y13w, ospf-MPLS, type-1
04-17-2018 06:28 AM - edited 04-17-2018 06:53 AM
Hi,
If you are referring to below command under the SVI, this has nothing to do with route preference, this is only for selecting what device will be the DR and what device will be the BDR.
ip ospf priority 110
The outbound traffic from your LAN will take the path for whichever device is the active HSRP. If you do a "sh ip hsrp brie" it will show you what switch is the active switch for each vlan and what is standby.
Also, the command to influence route preference is "ip ospf cost"
HTH
04-17-2018 01:38 PM
04-17-2018 11:49 PM - edited 04-18-2018 10:36 AM
Yes N9K01 is active hsrp on vlan105 and yes 10.10.254.252 is the primary mpls link on N9K01 while 10.10.254.253 is the secondary on N9K02. So primary mpls link is choosed based on interface valn 105 ospf priority ? no need to set cost ?
9K01
Interface Grp Prio P State Active addr Standby addr Group addr
Vlan105 105 100 P Active local 10.10.253.3 10.10.253.1 (conf)
Neighbor ID Pri State Up Time Address Interface
10.10.255.1 90 FULL/BDR 1y20w 10.10.253.3 Vlan105
7.28.132.32 1 FULL/DROTHER 1y24w 10.10.254.253 Vlan106
10.10.255.1 90 FULL/BDR 1y26w 10.10.254.3 Vlan106
192.168.100.9 1 FULL/DROTHER 1y26w 10.10.254.252 Vlan106
9K02
Interface Grp Prio P State Active addr Standby addr Group addr
Vlan105 105 100 P Standby 10.10.253.2 local 10.10.253.1 (conf)
Neighbor ID Pri State Up Time Address Interface
10.10.255.0 110 FULL/DR 1y20w 10.10.253.2 Vlan105
7.28.132.32 1 FULL/DROTHER 1y24w 10.10.254.253 Vlan106
10.10.255.0 110 FULL/DR 1y26w 10.10.254.2 Vlan106
192.168.100.9 1 FULL/DROTHER 1y26w 10.10.254.252 Vlan106
Just another question then in this case I have two link (primary on N9K01 and secondary on N9K02) but same ISP. Is this configuration suitable for two different ISP ? let's say N9K01 with link to ISP A and N9K02 with link to ISP B
Thanks
04-18-2018 04:26 PM
OSPF priority isn't OSPF cost. Priority is used for DR/BDR election.
When talking about 2 different ISPs, what you want to achieve?
Cost will be important if your firewall is doing OSPF with Nexus 9k switches. If you have hsrp on the subnet facing your firewall and you have a static route, cost will be useless because your static route on fw goes to hsrp VIP address which means goes to primary N9K and fallback to secondary N9K when primary goes down.
04-19-2018 01:59 AM
About ISP, now I have OSPF with same ISP, one router is primary link the other one is backup link. 9K01 is connected to primary router while 9K02 is connected to backup router. What about if I have two ISP, ISP A router as primary and ISP B router as secondary or backup ? OSPF configuration is still appropriate ?
now,
9K01 --> ISP A (primary router)
|
9K02 --> ISP A (backup router)
then,
9K01 --> ISP A (primary router)
|
9K02 --> ISP B (backup router)
04-19-2018 05:15 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide