How to distribute static route via OSPF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2013 02:56 PM - edited 03-07-2019 12:30 PM
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
- Labels:
-
Other Switching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2013 03:11 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2013 03:27 PM
Will that redistribute all static routes? Do i need to specify what static subnet i want to redistribute?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2013 03:35 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2013 03:39 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2013 03:48 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 05:44 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 07:39 AM - edited 08-02-2019 07:45 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 08:06 AM
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 😊
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2019 08:32 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 02:15 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2022 04:19 PM
thanks for sharing this info.
