07-17-2018 04:03 PM - edited 03-08-2019 03:43 PM
Hi Everyone,
I have switch running the ospf and it has ospf neig with inside network
router ospf 2
redistribute static subnets
ip route 0.0.0.0 0.0.0.0 192.42.147.x
ip route 10.70.34.0 255.255.255.0 192.42.147.x
With below config will this switch advertise the default route to its ospf domain?
What I want to achieve is to advertise the static routes with specific subnets but not the default route.
Regards
Mahesh
Solved! Go to Solution.
07-24-2018 12:29 PM
I believe that you are seeing the correct behavior. Remembering that OSPF works a bit differently from other dynamic routing protocols we can see that having a route for 0.0.0.0 does not necessarily result in advertising a default route. For OSPF to advertise a default route you need to configure default information originate.
Several responses treated your question assuming that the solution would be to control the redistribution and there were several good suggestions about how to use a route map to control redistribution. But they are not needed if your requirement is to advertise all static routes (other than the default route) and not to advertise a default route. Simply not configuring default information originate will achieve your requirements.
HTH
Rick
07-17-2018 06:25 PM - edited 07-17-2018 06:26 PM
You can control what static routes get distrubuted by using a route-map with 'redistribute static subnet' command.
redistribute static subnets route-map RED-to-OSPF
where route-map RED-to-OSPF would refer to an ACL with subnets allowed to be redistrubuted.
HTH.
07-17-2018 06:38 PM
Hi Mahesh,
Try to redistribute the static route using a route-map
route-map static-to-ospf permit 10
match ip address 1
access-list 1 permit 10.70.34.0 0.0.0.255
router ospf 2
redistribute static subnets route-map static-to-ospf
HTH
07-17-2018 07:08 PM - edited 07-18-2018 05:21 PM
do i need to apply this to the interface or vlan ?
show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
10.12.10.199 1 FULL/DR 00:00:35 10.0.12.65 Vlan2600
10.12.10.200 1 FULL/DR 00:00:35 10.0.12.61 Vlan2500
as this has connection to this
interface GigabitEthernet1/1/2
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 2500
switchport mode trunk
interface GigabitEthernet2/1/2
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 2600
switchport mode trunk
Regards
Mahesh
07-17-2018 09:07 PM
also it has current config under ospf
redistribute static subnets
so i can add the new config
redistribute static subnets route-map static-to-ospf
then remove the redistribute static subnets???????
07-18-2018 07:22 PM
also i tested in the lab ospf did not redistribute default route 0.0.0.0/0 into the ospf database.
can you confirm?
07-24-2018 12:29 PM
I believe that you are seeing the correct behavior. Remembering that OSPF works a bit differently from other dynamic routing protocols we can see that having a route for 0.0.0.0 does not necessarily result in advertising a default route. For OSPF to advertise a default route you need to configure default information originate.
Several responses treated your question assuming that the solution would be to control the redistribution and there were several good suggestions about how to use a route map to control redistribution. But they are not needed if your requirement is to advertise all static routes (other than the default route) and not to advertise a default route. Simply not configuring default information originate will achieve your requirements.
HTH
Rick
08-22-2018 07:50 PM
Hi Rich,
I did this change almost month ago and all work as you said in your post.
It is always pleasure to read reply from you.
Change went very well.
Best Regards
Mahesh
08-29-2018 06:43 AM
Mahesh
I am glad that my response was helpful. Thank you for marking this question as solved. I have enjoyed our discussions and am glad that you continue to be active in the community.
HTH
Rick
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