cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2910
Views
5
Helpful
16
Replies

Nexus 7010 - redistribute host routes in to OSPF

In my Nexus 7010 infrastructure, I have a requirement to redistribute host routes in to OSPF so that the other connected sites receive the host routes through OSPF.

These hosts are part of the connected network (192.168.100.0/24) on Nexus, I dont want this network to be advertised in to OSPF but I want the hosts inside this subnet (192.168.100.11 and 192.168.100.12) to be advertised.

I tried to create a prefix list with these two hosts and added them to a route-map and then using the "redistribute direct" command called this route-map in to OSPF, but this is not working.

However, if I add the entire subnet (the connected network) in to this route-map, it shows up in OSPF.

 

Is there a way I could have only the hosts to be part of the OSPF database?

16 Replies 16

Reza Sharifi
Hall of Fame
Hall of Fame

Try it with a standard access-list

access-list 100 permit host 192.168.100.11 any

access-list 100 permit host 192.168.100.12 any

route-map direct-to-ospf permit

match ip address 100

redis dire route-map direct-to-ospf

HTH

 

Thanks Reza, I tried the access list route before I posted this question, it doesn't work. :(

Jon Marshall
Hall of Fame
Hall of Fame

Are the host routes in the IP routing table ?

If not it won't work. Only routes that are in the routing table can be redistributed into another routing protocol.

If they aren't then a possible solution is to add host routes pointing to a valid next hop but you may not have a valid next hop.

In which case either a VDC or a VRF may be a solution.

I was involved in a thread recently where a similar issue came up so have a read of that to see if it helps you -

https://supportforums.cisco.com/discussion/12397471/inject-32-routes

like I say, if you can use valid next hop for your host routes then it should be easy but as you can see in the above thread that isn't always possible.

Jon

Thanks Jon, the routing table doesn't have the routes for the hosts as they are part of the connected network. Yes, I do understand that if I can't have them in the routing table, I cant have them redistributed in to OSPF.

It looks like I am hitting a dead end. :(

Have a read of that other thread.

You may be able to use the solution to achieve what you want.

Jon

Thanks Jon, I did go through the other thread, a good solution, it probably might work for me. Let me give it a try and will update this thread.

Hello, There is no need for VDC or VRF I think. are we missing a trick here. I also just tested for my own sanity. (Or am I completely under-thinking this)

N7K-1 has vlan 24 and the host route will be to 172.25.24.20

N7K-1 Config:

conf t

!

ip route 172.25.24.20/32 Vlan24

!

ip prefix-list TEST seq 5 permit 172.25.24.20/32

!

route-map STATIC_TO_OSPF permit 10
  match ip address prefix-list TEST

!

router ospf 1
  bfd
  router-id 192.168.101.1
  redistribute static route-map STATIC_TO_OSPF

 

here is what I see on its neighbour N7K2:

 

DC1-N7K2# show ip route 172.25.24.20
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>

172.25.24.20/32, ubest/mbest: 1/0
    *via 192.168.102.5, Eth8/1, [110/20], 00:00:07, ospf-1, type-2
DC1-N7K2#

 

                Type-5 AS External Link States

Link ID         ADV Router      Age        Seq#       Checksum Tag

172.25.24.20    192.168.101.1   479        0x80000002 0x0eed    0

 

So in essence point the host routes statically to the directly connected interface.

hth.

 

Bilal

Please rate useful posts & remember to mark any solved questions as answered. Thank you.

Bilal

Well if it's possible to enter a host route with a next hop like that then yes that is a much easier solution.

I am a little confused because in the other thread the OP couldn't do that. He tried using a vlan interface as a next hop and it wouldn't let him.

Looking at that other thread he was trying to do it within a VRF so I wonder if that was the issue ?

Jon

Bilal, It looks like your solution might work for me, however, I am finding some challenges, the route does show up in the OSPF and the routing table, but for some reason, I am not able to get the ping through. I am checking on what could be the problem.

Are you able to run a successful ping?

Hmm. I think it will need more than this to get it working. You are right, the pings fail... I would have thought the arp request would be sent out with this static route in place??

Though it seems to have had the desired effect in terms of routing, its actually no better than having a null0 route in, so my sincere apologies for that. Requires more thought.

With LISP it works - and tested the pings, this is becoming more of a common requirement, if only there was fast easy way of achieving this.

Please rate useful posts & remember to mark any solved questions as answered. Thank you.

After I logged off I realised I really was talking rubbish and there is no reason why this shouldn't work.

It's just a normal static route with an interface as the next hop.

Don't know what I was thinking :-)

So I then tested this in a simulator lab and it worked fine for me using the vlan interface as the next hop.

I'm not sure what the Nexus is doing to stop it working.

Unfortunately I don't have any real kit to test with but the lab does have pretty much fully featured L3 switches.

Edit - have a read of this link which is the Nexus configuration guide on static routing. If I am reading it correctly it is basically saying that you cannot use a broadcast interface for a directly connected network -

http://www.cisco.com/c/en/us/td/docs/switches/datacenter/sw/5_x/nx-os/unicast/configuration/guide/l3_cli_nxos/l3_route.html#wp1076779

but I have to say it's not the clearest piece of documentation I have ever read so I may be misunderstanding it.

Jon

Hmmm. Yeah i thought it should work, thanks for testing that. On N7Ks I am not too sure. If, what they say in the documentation is as we understand, i wonder if we could try this:

ip route x.x.x.x/32 vlan y x.x.x.x

Specifying an interface and also a next hop of the actual address, where x.x.x.x is the same IP.

Please rate useful posts & remember to mark any solved questions as answered. Thank you.

It would be worth a try if you get the chance although I think it might complain about the next hop IP being the same as the destination route.

I haven't used Nexus but when/if I do I hope the rest of the documentation is a bit clearer than that :-)

Jon

Hi All / Jon,

It worked ;)

When you specify ip route x.x.x.x/32 vlan y x.x.x.x Where x.x.x.x is the same host address, redistribute this in to OSPF, the pings throughout the network works perfectly fine. Just need to define the next hop on the interface.

Learnt something new!

Hope this helps

Bilal

Please rate useful posts & remember to mark any solved questions as answered. Thank you.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card