cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3175
Views
20
Helpful
17
Replies

ip default-gateway and default-information originate

mahesh18
Level 6
Level 6

 

 

 

Hi Everyone,

 

 

Currently our 3750 switch has below config

 

Current Switch running ospf

 

ip default-gateway x.x.x.x

ip classless

ip route 0.0.0.0 0.0.0.0 x.x.x.x

 

 

router ospf 1

 

default-information originate metric 10 metric-type 1

 

 

As I need to change the network design we want some other switch in network to advertise the default route config

 

New Switch running ospf

 

ip route 0.0.0.0 0.0.0.0 x.x.x.x

 

router ospf 1

 

default-information originate metric 10 metric-type 1

 

 

But we want current switch even if it learn the default gateway from the nei switch it should follow the current ip default gateway  x.x.x.x

 

So my question is even if current switch learn the default route via ospf nei will config ip default gateway take priority over it?

 

Regards

MAhesh

4 Accepted Solutions

Accepted Solutions

Hi Mahesh,

On current 3750 I need to remove the default information originate command that is for sure.

That is fine but remember if you remove that, you will lose your outbound Internet redundancy because all the devices will only learn one default route (from the new switch)  and out Internet2. So, if for example, the connection between the core switch and the new 3750 fails, the traffic has no where to go and cannot reach Internet1 since there is no other default route to learn.

If I remove the OSPF then how current switch will communicate with immediate connected switch?

You have to use static routes.

Is there any command that we can run on 3750 so that we can see if we remove ospf then which static 

routes we need to add?

You just need to look at the current routing table and whatever routes you are learning from the firewall and the current switch need to be replaced with static routes. So, on the current 3750, you need static routes to learn all the routes you are learning from OSPF which is from the core switch and the new switch. 

So again is there any way we can keep running ospf on current switch and make sure it has static route

route 0.0.0.0/0 next hop firewall   

Yes, you can simply add route 0.0.0.0/0 next hop firewall and delete the default-information originate command from OSPF but again you will lose the redundancy because there isn't a second default route on other devices routing table. So, everything else besides the current switch and the firewall on left will always go out Internet2.

HTH

 

 

 

 

View solution in original post

Yogi-Bear
Level 1
Level 1
Just remove default information originate on current and youre good to go.

If you use both the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to configure candidate default networks, and the network used by the ip default-network command is known statically, the network defined with the ip default-network command takes precedence and is chosen for the gateway of last resort

View solution in original post

Hi Mahesh,

redistribute static subnets is not going to redistribute the default route into OSPF.  You need  default-information originate command.

https://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/47868-ospfdb9.html

HTH

View solution in original post

Hi Mahesh,

That is correct.

HTH

View solution in original post

17 Replies 17

Reza Sharifi
Hall of Fame
Hall of Fame

Hi Mahesh,

So my question is even if current switch learn the default route via ospf nei will config ip default gateway take priority over it?

In this case, the ip default gateway command will not be effective since you already have a default route pointing to the same ip next hop.

In addition, the ip default gateway command is usually used for layer-2 switches with no routing enabled.

HTH

Hi Reza,

 

I need to remove the below config from the current switch

ip route 0.0.0.0 0.0.0.0 x.x.x.x

default information originate 

 

This is what I want to achieve on current switch I do not want to point to the new default gateway learned by new new switch(default information originate)

 

I want that current switch should use its current default gateway and do not advertise that to ospf.

 

Regards

Mahesh

Hi Mahesh,

The default route should be advertised from the closest device to the Internet. So, if the new switch you are deploying is the closest switch to internet and is advertising a default route to the current switch, you can simply remove the commands you listed from the current switch and the current switch will run OSPF and get the default route from the new switch.

Is that what you are trying to do?

Maybe a simple diagram can clarify it.

HTH

Yes that is one part of story.

i have attached the network diagram.

 

where diagram on left is current one and diagram on right hand side is new one.

 

what i need is that if i remove the ip route 0.0.0.0/0 and default information originate command from current network and advertise on new switch.

 

Then on current switch i want that users going to DMZ network follow the same path not the new network.

what i want is that current switch it it do not know any network route it should point to fw as next hop

where diagram on left is current one and diagram on right hand side is new one.

On your diagram, both sides look exactly the same.  I don't see anything new. What am I I missing?

Is the whole diagram all one network with redundant connections (access, disto, core, etc..) or you only have the left side and trying to add the right side to the network?

Can you clarify?

HTH

sorry for cauisng the confusion.

 

i have modifies the diagram please take look now.

all we want is that to advertise the default route to internet from new switch connected to the firewall from right hand side.

 

So that all the ospf routers can learn the default gateway.

that thing has no issues.

my only concern is that current 3750 switch should not listen to the new default route and it should still

point to the firewall for default gateway as we have many networks behind the dmz.

 

Regards

MAhesh

Hi Mahesh,

How about this:

Advertise a default route from the new switch on the right side, so all traffic from the core, distro, and access switch take that path and go out Interner2. Then on the left side have the firewall advertise a default route to the current 3750 switch, so all traffic from DMZ take that path and go out Internt1. Now don't run OSPF between the current 3750 and the core switch and just use static routes this way the current 3750 does not see the default route from the new switch.

You can also keep the same setup with one default route from the current 3750 and one from the new 3750 and use a higher metric on one of them to make it less preferable. For example, the current 3750 would prefer to go out using Internet1 and use the Internet2 as its backup.

Is that what you are trying to do?

HTH

Hi Reza,

 

On current 3750 I need to remove the default information originate command that is for sure.

If I remove the OSPF then how current switch will communicate with immediate connected switch?

Is there any command that we can run on 3750 so that we can see if we remove ospf then which static 

routes we need to add?

 

Other thing for now I need OSPF running on current switch  if my change goes south.

 

So again is there any way we can keep running ospf on current switch and make sure it has static route

route 0.0.0.0/0 next hop firewall   

 

and this do not get advertised into ospf then in that case this current 3750 switch will not use the new

default route learned.Can we used some route map to make this happen?

Hi Mahesh,

On current 3750 I need to remove the default information originate command that is for sure.

That is fine but remember if you remove that, you will lose your outbound Internet redundancy because all the devices will only learn one default route (from the new switch)  and out Internet2. So, if for example, the connection between the core switch and the new 3750 fails, the traffic has no where to go and cannot reach Internet1 since there is no other default route to learn.

If I remove the OSPF then how current switch will communicate with immediate connected switch?

You have to use static routes.

Is there any command that we can run on 3750 so that we can see if we remove ospf then which static 

routes we need to add?

You just need to look at the current routing table and whatever routes you are learning from the firewall and the current switch need to be replaced with static routes. So, on the current 3750, you need static routes to learn all the routes you are learning from OSPF which is from the core switch and the new switch. 

So again is there any way we can keep running ospf on current switch and make sure it has static route

route 0.0.0.0/0 next hop firewall   

Yes, you can simply add route 0.0.0.0/0 next hop firewall and delete the default-information originate command from OSPF but again you will lose the redundancy because there isn't a second default route on other devices routing table. So, everything else besides the current switch and the firewall on left will always go out Internet2.

HTH

 

 

 

 

Yogi-Bear
Level 1
Level 1

3

Yogi-Bear
Level 1
Level 1
Just remove default information originate on current and youre good to go.

If you use both the ip default-network and ip route 0.0.0.0 0.0.0.0 commands to configure candidate default networks, and the network used by the ip default-network command is known statically, the network defined with the ip default-network command takes precedence and is chosen for the gateway of last resort

Hi Bobby,

 

Thanks for replying to the post.

So i will remove the default information originate from the current switch.

As you say if i leave below config 

 ip default-network

ip route 0.0.0.0 0.0.0.0 

 

Then current switch will use ip default-network over ip route o.o.o.o/o?

Also under ospf i have this config 

redistribute static subnets

 

will this cause the ip route 0.0.0.0 0.0.0.0 next hop command to be advertised to ospf?

 

Regards

Mahesh

 

Hi Mahesh,

redistribute static subnets is not going to redistribute the default route into OSPF.  You need  default-information originate command.

https://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/47868-ospfdb9.html

HTH

 

Hi Reza,

 

 

One last thing to confirm if this current switch learns the default route via ospf then it will still prefer the

static route 0.0.0.0/0 configured on it as it has lower metric right?

 

Best Regards

Mahesh

Review Cisco Networking for a $25 gift card