cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
99928
Views
16
Helpful
11
Replies

How to distribute static route via OSPF

Jason Flory
Level 1
Level 1

Hello Everyone,

We have a 14 offfice MPLS network.  All offices have Cisco 3750s running OSPF which replicate route tables via our providers BGP peers.   I am introducing a new network in our SF office which is not directly connected so in SF we have a static route "ip route 172.16.20.0 255.255.255.0 192.168.100.1. I want our other offices to learn this route route via OSPF so that they know how to get to the new network.  My problem is that of course remote sites do not see our static routes and i  have tried to add this via ospf but the switch will not propagate this route because it is not directly connected to the switch in SF.

Config

router ospf 1

log-adjacency-changes

network 10.2.0.0 0.0.0.255 area 2.2.2.2

network 10.2.2.0 0.0.0.255 area 2.2.2.2

network 10.2.3.0 0.0.0.255 area 2.2.2.2

network 10.2.4.0 0.0.0.255 area 2.2.2.2

network 10.2.5.0 0.0.0.255 area 2.2.2.2

network 10.2.6.0 0.0.0.255 area 2.2.2.2

network 10.2.7.0 0.0.0.255 area 2.2.2.2

network 10.2.8.0 0.0.0.255 area 2.2.2.2

network 10.2.9.0 0.0.0.255 area 2.2.2.2

network 10.2.10.0 0.0.0.255 area 2.2.2.2

network 10.2.254.0 0.0.0.255 area 2.2.2.2

network 10.2.255.0 0.0.0.255 area 2.2.2.2

network 172.16.20.0 0.0.0.255 area 2.2.2.2  (this is the network i want to propagate to other offices.)

network 192.168.100.0 0.0.0.255 area 0

default-information originate metric 1

!

ip classless

ip route 0.0.0.0 0.0.0.0 10.2.0.2

ip route 10.8.0.0 255.255.0.0 192.168.100.218

ip route 10.167.110.0 255.255.255.224 172.16.30.1

ip route 172.16.20.0 255.255.255.0 10.2.0.3 (same network here)

ip route 172.16.40.0 255.255.255.0 10.2.0.6

Thanks

11 Replies 11

Reza Sharifi
Hall of Fame
Hall of Fame

Hi,

ip route 172.16.20.0 255.255.255.0 10.2.0.3 (same network here)

If you want to prorogate this static route to OSPF, you need to redistribute it to OSPF

and no need for network statment (network 172.16.20.0 0.0.0.255 area 2.2.2.2)

Router ospf 1

redis static subnet

HTH

Will that redistribute all static routes?  Do i need to specify what static subnet i want to redistribute?

Yes, that will redistribute all static route.  If you want to only redistribute that one static route, you need to use a route-map

redi stat sub route-map

See example in this link

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a008009487e.shtml

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a008047915d.shtml

HTH

I was just curious.  It is ok to redistribute all statics however i tried adding that to our config and i do a show ip route on remote sites and they are not learing the route.

If you need to redistribute all statics, then you should do so, if not then just redistribute the one you want with a route-map.

On the router you have created the static route, can you issue "sh ip route static" and post it here? You should be able to see the static route you created. Can you check?

Hi,

 

a networking newb here, if you choose to redistribute your static routes via OSPF, does the AD change for that static route?

 

Thanks,

 

Mike

Hello Mike,

 

>> a networking newb here, if you choose to redistribute your static routes via OSPF, does the AD change for that static route?

 

No, the redistribution allows to inject the static route in the OSPF links state database as an external LSA type 5 ( OE1 or O E2) if the static route is installed in the IP routing table of the router performing redistribution.

 

OSPF requires the use of subnets keyword to avoid classful summarization.

So a correct configuration could be:

 

router ospf 10

redistribute static subnets

 

if you want to redistribute only a sub-set of static routes you can use a route-map.

 

ip prefix-list SELECT-STATIC permit 172.30.20.0/24

 

route-map SOME-STATIC-INTO-OSPF permit 10

match ip address prefix SELECT-STATIC

 

 

router ospf 10

redistribute static route-map SOME-STATIC-INTO-OSPF subnets

 

The AD distance of the static route on the ASBR node is left unchanged.

 

On other OSPF routers in backbone and standard areas the LSA type 5 for the prefix is installed as O E1 or O E2 route (the type of route is chosen at the moment of redistribution with O E2 being the default type ) and have default OSPF AD 110.

 

Hope to help

Giuseppe

 

It does help thank you.
The reason I asked is because I recently took my CCNA, which unfortunately I did not pass, but in my OSPFv3 lab, they wanted to static route to the ISP interface and at the time I drew a blank on how to do that, but I think now as a afterthought they most likely wanted that route once configured to be injected in OSPF so that that static route was seen by the other routers in the lab.
I will try this today in Packet Tracer 😊

Hello Mike,

yes I do agree in OSPFv3 there are some specific aspects related to redistribution of connected routes (a special command is needed).

However, if the route was a default route you should have used default-information originate as redistribution of a default static route is not possible on cisco devices (at least in OSPFv2)

 

Hope to help

Giuseppe

 

I agree with Giuseppe EXCEPT for NX-OS - below from the Docs and testing in the lab 

Note  If you redistribute static routes, Cisco NX-OS also redistributes the default static route.

Cisco Nexus 7000 Series NX-OS Unicast Routing Command Reference - R Commands [Support] - Cisco

thanks for sharing this info.

Review Cisco Networking products for a $25 gift card