cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
928
Views
0
Helpful
10
Replies

OSPF N9K

marmellata08
Level 1
Level 1

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 ?

10 Replies 10

Francesco Molino
VIP Alumni
VIP Alumni

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).

 


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

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 ? 

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?

 

 


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

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

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

There's no difference in ospf cost between both nexus switches based on what you shared. However, you have hsrp on vlan 106 and one of them has been elected as primary. Can you share sh hsrp brief output?
The traffic will hit the primary hsrp N9K from your firewall and traffic will go then to your ISP.
All routes are pointing to 10.10.254.252. Is it your Primary link?
Both primary and secondary links are from the same ISP I believe and you have an MPLS cloud, right?
Can you share output of sh ip ospf neigh from both nexus?

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

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

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.

 


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

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)

Again, it depends what you want to achieve. If you want to do load balancing traffic between 2 ISPs then we need to know how your firewall is routing to internet (static or ospf). Right now, no opsf cost, then no preference, this means equal cost ospf route from both routers. You can also see that routes from each router goes straight to ISP router.

What's your real question, what do you want to achieve?

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question
Review Cisco Networking for a $25 gift card