cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2338
Views
5
Helpful
8
Replies

redistribute static subnets and ip route 0/0

mahesh18
Level 6
Level 6

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

 

 

1 Accepted Solution

Accepted Solutions

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

HTH

Rick

View solution in original post

8 Replies 8

rais
Level 7
Level 7

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.

Reza Sharifi
Hall of Fame
Hall of Fame

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

 

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

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???????

also i tested in the lab ospf did not redistribute default route 0.0.0.0/0 into the ospf database.

can you confirm?

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

HTH

Rick

 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

 

 

 

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

HTH

Rick
Review Cisco Networking products for a $25 gift card