OSPF, Multiple default routes

Answered Question
Jun 28th, 2007

I have the OSPF network setup as attached. OSPF is running ony on routers and L3 switch. I would like to inject 2 default routes into the Layer 3 switch.

Both routers C and D gets the default route as expected. But the L3 switch inserts default route as Router C only.

I would like to see 2 default routes on the switch as both the links have same cost. How can I troubleshoot this?

The command "SHOW IP OSPF DATABASE" shows the following output on the L3 switch.

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag

0.0.0.0 10.0.0.9 701 0x8000E7D4 0x5D24 65182

0.0.0.0 10.0.0.54 442 0x8000E7EB 0x4EEA 65182

But the show ip route command on the L3 switch shows only one default route.

Thank You

I have this problem too.
0 votes
Correct Answer by Harold Ritter about 9 years 6 months ago

Avil,

If you remove the network statement then you do not need to configure the interface as passive. Either way should work.

Can you do a show ip ospf border on L3-Switch to see if both ASBRs (Rtr-A and Rtr-B) are considered as equal cost.

Let me know if this solves your problem,

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (6 ratings)
Loading.
sundar.palaniappan Thu, 06/28/2007 - 18:18

What you are seeing is the normal behavior. L3 switch prefers the default route via RouterC because it's intra-area route whereas the default route via RouterD is inter-area route. OSPF always prefers the intra-area route over inter-area route even if the cost is more via intra-area route. You can address this problem by making both the RTRC -->RTRA and RTRD-->RTRB connections to be either intra-area or inter-area links.

HTH

Sundar

avilt Thu, 06/28/2007 - 18:22

Thank You very much for the update. Could you please tell me as how to configure this.

sundar.palaniappan Thu, 06/28/2007 - 18:26

You can configure the link between RTRD and RTRB to be part of Area0 and that would make L3 switch see both default routes as intra-area route and if the cost is the same it would use both routes.

HTH

Sundar

avilt Thu, 06/28/2007 - 20:26

That will put all the routers into single area Area0. Is it not possible to have multiple areas and still have multiple default routes?

Thank You

sundar.palaniappan Fri, 06/29/2007 - 04:19

Sure, in that case you need to put the link between RTRA and RTRC in non-area0. This would make both routes show up as inter-area routes from L3 switch perspective.

HTH

Sundar

avilt Fri, 06/29/2007 - 05:30

I have 2 ISP's(Red and Blue) each in separate area's connected to separate router. I cannot put RTRA and RTRC in non-area0. Kindly advise..

Thanks

sundar.palaniappan Fri, 06/29/2007 - 05:50

I am thinking that none of the routers in the diagram is connected directly to the ISP and the ISP connections terminate on another router(s) sitting outside of your firewall, correct?

HTH

Sundar

Harold Ritter Fri, 06/29/2007 - 05:53

Avil,

In order for both default routes to be installed in the RIB, the cost to the 2 ASBRs would need to be the same.

Hope this helps,

Harold Ritter Fri, 06/29/2007 - 07:01

I forgot. That is assuming the external metric and the metric type (E1 vs E2) are also the same, whic should be by default.

Regards,

sundar.palaniappan Fri, 06/29/2007 - 11:09

Avil,

Sorry for the oversight on my part. Your first post clearly shows the default route is an external route and not intra or inter-area route as I had stated in my previous post.

As Harold stated if the L3 switch learns the default route from RTR-C and RTR-D with the same metric and type (E2) then it should use both default routes. Given the fact L3 switch uses only the route via RTR-C I suspect the metrics mayn't be the same.

Can you post the output 'show ip ospf database external 0.0.0.0'. This would show the metric and whether they are of the same type.

HTH

Sundar

avilt Fri, 06/29/2007 - 17:13

L3SWITCH#show ip ospf database external 0.0.0.0

OSPF Router with ID (172.16.0.254) (Process ID 65182)

Type-5 AS External Link States

Routing Bit Set on this LSA

LS age: 1413

Options: (No TOS-capability, DC)

LS Type: AS External Link

Link State ID: 0.0.0.0 (External Network Number )

Advertising Router: 10.0.0.9

LS Seq Number: 8000E7FE

Checksum: 0x94E

Length: 36

Network Mask: /0

Metric Type: 2 (Larger than any link state path)

TOS: 0

Metric: 1

Forward Address: 10.0.0.1

External Route Tag: 65182

Routing Bit Set on this LSA

LS age: 1300

Options: (No TOS-capability, DC)

LS Type: AS External Link

Link State ID: 0.0.0.0 (External Network Number )

Advertising Router: 10.0.0.54

LS Seq Number: 8000E815

Checksum: 0xF816

Length: 36

Network Mask: /0

Metric Type: 2 (Larger than any link state path)

TOS: 0

Metric: 1

Forward Address: 10.0.0.1

External Route Tag: 65182

Note:

OSPF is running only on Routers A,B,C,D and L3switch. Routers A-C is connected to ISP "RED" area0 and Routers B-D connected to ISP "BLUE" area1. L3SWITCH is in area0. I would like to see 2 default routes on L3SWITCH.

Harold Ritter Fri, 06/29/2007 - 17:19

As I stated in a previous posting, the metrics to the two ASBRs have to be equal for both routes to be installed in the RIB, which they probably are not.

You can do a show ip route for 10.0.0.9 and 10.0.0.54 to find out what the metric is to the each ASBR.

Hope this helps,

Harold Ritter Fri, 06/29/2007 - 17:47

Actually, it is preferable to do a "show ip ospf border-routers" on the router where you expect the two default routes to be installed in the RIB. This will give you more valuable info.

Regards,

Harold Ritter Fri, 06/29/2007 - 18:15

I had overlooked one thing. The external routes both have a "forward address" of 10.0.0.1. When an external route has a "forward address" the internal distance to the external route is calculated via the metric to the "forward address" rather than the metric to the ASBR.

In your case the route to 10.0.0.1 via area 0 is better than the one via area 1 (intra area vs inter area) so the external route from ASBR 10.0.0.54 is therefore preferred.

One way to change that is to get rid of the "forward address" on both external routes. You can get rid of the "forward address by setting the interface towards the FW on RTR-A and RTR-B as passive. You will immediately see the "forward address" change to 0.0.0.0 and the decision will then be based on the distance to the ASBRs (seen in show ip ospf border-routers). Assuming the links from L3 Switch to RTR-A and RTR-b are equal costs, you should get the results you are expecting, meaning the two default routes being installed in the RIB on L3 Switch.

Hope this helps,

avilt Sun, 07/01/2007 - 21:29

Thank You for the valuable inputs.

So I will enable passive interface on both the routers towards the firewall. I should also disable the ospf command "network 10.0.0.0 255.0.0.0 area0/1" right?

Thank You very much

Correct Answer
Harold Ritter Mon, 07/02/2007 - 05:07

Avil,

If you remove the network statement then you do not need to configure the interface as passive. Either way should work.

Can you do a show ip ospf border on L3-Switch to see if both ASBRs (Rtr-A and Rtr-B) are considered as equal cost.

Let me know if this solves your problem,

avilt Mon, 07/02/2007 - 16:26

Entered "passive interface" command on RTRB(Area1), now the L3Switch takes default route via RTRB. I will try the same command on RTRA later. Anyway thank you very much for the help.

Harold Ritter Mon, 07/02/2007 - 17:28

Avil,

Have you tried the show ip ospf border command just to make sure that both ASBRs are considered equal by L3-switch.

Regards,

avilt Mon, 07/02/2007 - 17:58

Yes, the cost is same to reach RTRA & RTRB.

L3SWITCH#show ip ospf border-routers

OSPF Process 65182 internal Routing Table

Codes: i - Intra-area route, I - Inter-area route

I 10.0.0.9 [2] via 172.16.0.9, Port-channel10.20, ASBR, Area 0, SPF 37

i 172.16.0.54 [1] via 172.16.0.54, Port-channel10.20, ASBR, Area 0, SPF 37

i 10.0.0.54 [2] via 172.16.0.54, Port-channel10.20, ASBR, Area 0, SPF 37

i 172.16.0.9 [1] via 172.16.0.9 , Port-channel10.20, ABR, Area 0, SPF 37

Harold Ritter Tue, 07/03/2007 - 04:09

Wonderful. The passive interface trick should definitely solve the issue then.

Regards,

Actions

This Discussion