Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

OSPF external route selection problem

Hello. I have a situation where I got two paths to get to a destination. Router A can get to subnet C either through my Telco's onsite router (Router A->telco router->Router C)or through a secondary link that travels from Router A-> Router B->diffenent Telco router->Router C.

The link between Router A and the telco router is area 0. The link between Router A->B->Telco router is also area 0.

Normally I want traffic to go directly through the onsite telco router...and only go through the longer route if the onsite router goes down.

For some reason I'm going through the suboptimal path. Here's what the OSPF database is telling me:

Routing Bit Set on this LSA

LS age: 1267

Options: (No TOS-capability, DC)

LS Type: AS External Link

Link State ID: 192.168.33.0 (External Network Number )

Advertising Router: 192.168.50.14

LS Seq Number: 80000084

Checksum: 0x4B8B

Length: 36

Network Mask: /24

Metric Type: 1 (Comparable directly to link state metric)

TOS: 0

Metric: 100

Forward Address: 0.0.0.0

External Route Tag: 66

LS age: 262

Options: (No TOS-capability, DC)

LS Type: AS External Link

Link State ID: 192.168.33.0 (External Network Number )

Advertising Router: 192.168.50.94

LS Seq Number: 800003B8

Checksum: 0xF757

Length: 36

Network Mask: /24

Metric Type: 1 (Comparable directly to link state metric)

TOS: 0

Metric: 100

Forward Address: 0.0.0.0

External Route Tag: 66

Both telco routers advertise this route as an extern type 1 with a metric of 100. Can anyone shed some light as to why my router is picking the path via 50.14 instead of 50.94? 50.94 is a locally connected network. 50.14 is a couple of hops away.

Thanks,

Mike

15 REPLIES
VIP Purple

Re: OSPF external route selection problem

Hello Mike,

can you post the output of 'show ip ospf border-routers' ?

The only way (I know of) for a path to be selected, if two external LSAs are present, is for that LSA to have the shortest path to the ASBR...which indeed wouldn't make sense in your situation, since the path that is NOT selected has the shortest path...

Regards,

GP

New Member

Re: OSPF external route selection problem

No problem.

Here's the output...

show ip ospf border-routers

OSPF Process 2 internal Routing Table

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

OSPF Process 1 internal Routing Table

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

i 10.0.22.3 [2] via 192.168.19.14, Vlan168, ABR/ASBR, Area 0, SPF 42

i 10.0.22.2 [2] via 192.168.19.2, Vlan168, ABR/ASBR, Area 0, SPF 42

i 192.168.30.5 [501] via 192.168.19.15, Vlan168, ASBR, Area 0, SPF 42

i 192.168.30.5 [501] via 192.168.19.14, Vlan168, ASBR, Area 0, SPF 42

i 172.29.50.1 [1] via 192.168.19.11, Vlan168, ASBR, Area 0, SPF 42

i 172.18.1.2 [3] via 192.168.19.15, Vlan168, ABR/ASBR, Area 0, SPF 42

i 172.18.1.3 [2] via 192.168.19.15, Vlan168, ABR/ASBR, Area 0, SPF 42

i 192.168.1.5 [1] via 192.168.19.8, Vlan168, ASBR, Area 0, SPF 42

i 10.0.32.2 [2] via 192.168.19.15, Vlan168, ABR/ASBR, Area 0, SPF 42

i 10.0.32.3 [2] via 192.168.19.3, Vlan168, ABR/ASBR, Area 0, SPF 42

i 172.27.95.1 [2] via 192.168.19.16, Vlan168, ABR/ASBR, Area 0, SPF 42

i 172.19.1.3 [1] via 192.168.19.15, Vlan168, ABR/ASBR, Area 0, SPF 42

i 172.19.1.2 [1] via 192.168.19.14, Vlan168, ABR/ASBR, Area 0, SPF 42

i 10.0.24.2 [1] via 192.168.19.22, Vlan168, ABR/ASBR, Area 0, SPF 42

i 10.0.24.3 [1] via 192.168.19.23, Vlan168, ABR/ASBR, Area 0, SPF 42

i 192.168.19.4 [1] via 192.168.19.4, Vlan168, ASBR, Area 0, SPF 42

i 172.27.87.1 [1] via 192.168.19.12, Vlan168, ASBR, Area 0, SPF 42

i 192.168.19.19 [1] via 192.168.19.19, Vlan168, ASBR, Area 0, SPF 42

i 172.20.1.2 [3] via 192.168.19.3, Vlan168, ASBR, Area 0, SPF 42

i 172.20.1.3 [2] via 192.168.19.3, Vlan168, ASBR, Area 0, SPF 42

I 10.0.16.11 [2] via 192.168.19.3, Vlan168, ASBR, Area 0, SPF 42

I 10.0.16.11 [3] via 192.168.19.2, Vlan168, ASBR, Area 0, SPF 42

I 10.0.16.10 [2] via 192.168.19.2, Vlan168, ASBR, Area 0, SPF 42

I 192.168.50.14 [2] via 192.168.19.14, Vlan168, ASBR, Area 0, SPF 42

i 192.168.50.94 [100] via 192.168.50.94, Vlan162, ASBR, Area 0, SPF 42

i 172.21.1.2 [1] via 192.168.19.16, Vlan168, ASBR, Area 0, SPF 42

i 10.0.229.2 [1] via 192.168.19.24, Vlan168, ABR/ASBR, Area 0, SPF 42

i 10.0.17.2 [2] via 192.168.19.2, Vlan168, ABR/ASBR, Area 0, SPF 42

i 10.0.17.3 [2] via 192.168.19.3, Vlan168, ABR/ASBR, Area 0, SPF 42

i 192.168.8.1 [1] via 192.168.19.28, Vlan168, ASBR, Area 0, SPF 42

i 192.168.16.173 [565] via 192.168.19.14, Vlan168, ABR/ASBR, Area 0, SPF 42

i 192.168.16.173 [565] via 192.168.19.15, Vlan168, ABR/ASBR, Area 0, SPF 42

i 172.27.193.2 [1] via 192.168.19.20, Vlan168, ASBR, Area 0, SPF 42

i 172.16.1.2 [1] via 192.168.19.2, Vlan168, ABR/ASBR, Area 0, SPF 42

i 172.16.1.3 [1] via 192.168.19.3, Vlan168, ABR/ASBR, Area 0, SPF 42

VIP Purple

Re: OSPF external route selection problem

Hello,

from your output, it looks like both border routers have different outgoing interfaces, Vlan 168 for the 50.14 router, and Vlan 162 for the 50.94 router. If I read this correctly, it appears that 192.168.50.94 is part of Vlan 162 and not 168, can you check that ?

I 192.168.50.14 [2] via 192.168.19.14, Vlan168, ASBR, Area 0, SPF 42

i 192.168.50.94 [100] via 192.168.50.94, Vlan162, ASBR, Area 0, SPF 42

Regards,

GP

New Member

Re: OSPF external route selection problem

Hello. Yes, each subnet is available via a different vlan. From the output of the command it shows that 192.168.50.94 is an intra-area and 192.168.50.14 is a inter-area one. Should the router choose the intra-area one first over the inter-area one?

Thanks,

Mike

Re: OSPF external route selection problem

Hello,

from

I 192.168.50.14 [2] via 192.168.19.14, Vlan168, ASBR, Area 0, SPF 42

i 192.168.50.94 [100] via 192.168.50.94, Vlan162, ASBR, Area 0, SPF 42

i

you can see, that the metric to reach 50.14 is 2 whereas the metric to reach 50.94 is 100. So I would assume based on this metric always 50.14 should be taken, because it is "closer". The question I cannot answer without detailed knowledge about your topology and VLANs is. why there is a metric of 100 for 50.94 and only 2 for the other router. perform a trace and check your topology, what might be the cause for this. Maybe the different VLAN has to do with it.

Once 50.94 has a better metric it should be the prefered path.

Hope this helps! Please rate all posts.

Regards, Martin

New Member

Re: OSPF external route selection problem

Hi Martin,

In this particular case does it matter if 192.168.50.14 is an inter-area route vs 50.94 is a intra-area?

This is what I get when I do a show ip route for both subnets

show ip route 192.168.50.14

Routing entry for 192.168.50.8/29

Known via "ospf 1", distance 110, metric 2, type inter area

Last update from 192.168.19.14 on Vlan168, 07:37:50 ago

Routing Descriptor Blocks:

* 192.168.19.14, from 172.19.1.2, 07:37:50 ago, via Vlan168

Route metric is 2, traffic share count is 1

show ip route 192.168.50.94

Routing entry for 192.168.50.88/29

Known via "connected", distance 0, metric 0 (connected, via interface)

Redistributing via ospf 1, ospf 2

Routing Descriptor Blocks:

* directly connected, via Vlan162

Route metric is 0, traffic share count is 1

Since 192.168.50.88 is locally connected shouldn't the router choose this interface instead of the 50.14?

Thanks

Mike

Purple

Re: OSPF external route selection problem

G'day Mike,

Would you be able to post the output of:

'sh ip ospf interface vlan168' and

'sh ip ospf interface vlan162' ?

Thanks,

Paresh

New Member

Re: OSPF external route selection problem

Hi Paresh,

No problem. Here's the show commands...

show ip os int vlan 168

Vlan168 is up, line protocol is up

Internet Address 192.168.19.5/24, Area 0

Process ID 1, Router ID 172.27.161.1, Network Type BROADCAST, Cost: 1

Transmit Delay is 1 sec, State DROTHER, Priority 1

Designated Router (ID) 172.19.1.2, Interface address 192.168.19.14

Backup Designated router (ID) 172.16.1.2, Interface address 192.168.19.2

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

oob-resync timeout 40

Hello due in 00:00:00

Supports Link-local Signaling (LLS)

Index 1/2, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 0, maximum is 40

Last flood scan time is 0 msec, maximum is 9 msec

Neighbor Count is 17, Adjacent neighbor count is 2

Adjacent with neighbor 172.16.1.2 (Backup Designated Router)

Adjacent with neighbor 172.19.1.2 (Designated Router)

Suppress hello for 0 neighbor(s)

Simple password authentication enabled

show ip os int vlan 162

Vlan162 is up, line protocol is up

Internet Address 192.168.50.90/29, Area 0

Process ID 1, Router ID 172.27.161.1, Network Type BROADCAST, Cost: 100

Transmit Delay is 1 sec, State DR, Priority 250

Designated Router (ID) 172.27.161.1, Interface address 192.168.50.90

No backup designated router on this network

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

oob-resync timeout 40

Hello due in 00:00:02

Supports Link-local Signaling (LLS)

Index 2/3, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 5, maximum is 49

Last flood scan time is 0 msec, maximum is 9 msec

Neighbor Count is 1, Adjacent neighbor count is 1

Adjacent with neighbor 192.168.50.94

Suppress hello for 0 neighbor(s)

Simple password authentication enabled

Thanks in advance.

Mike

Purple

Re: OSPF external route selection problem

Hi Mike,

If you configure the following, I believe it may solve your problem:

interface vlan162

ip ospf cost 1

Pls try that out and see how you go....pls rate posts that help.

Regards,

Paresh

New Member

Re: OSPF external route selection problem

That did the trick Paresh. It's going through the right interface now!

I was wondering if you could tell me how come the cost of the interface would have an effect in this situation? I'm new to OSPF and I thought intra-area routes would be picked over inter-area...regardless of cost.

Thanks

Mike

Purple

Re: OSPF external route selection problem

Hi Mike,

I'm not sure why you are thinking that that you have both inter-area and intra-area routes. The routes to both the ASBRs are intra-area ... since they both belong to Area 0.

In any case, that is not the issue. For the purpose of route selection, the route in question is in fact, an external route.

Now, with OSPF, there are two types of external metrics:

- Type 1 external metrics are expressed in the same units as OSPF interface cost

- Type 2 external metrics are an order of magnitude larger; any Type 2 metric is considered greater than the cost of any path internal to the AS

So if you have an ASBR injecting a type-1 external into the domain, the cost to this route is worked out as:

- (cost to reach the ASBR) + (cost of external route).

If you have an ASBR injecting a type-2 external into the domain, the cost to this route is worked out as:

- (cost of external route).

In your case, the route is a type-1 external with a cost of 100. The two ASBRs, as shown by the output of 'sh ip ospf border-routers' had internal metrics of 2 and 100, respectively. The total cost to reach your external route was 102 and 200, respectively. Therefore, the first route was picked. When you changed the cost of that VLAN interface to 1, the total cost to the external destination through that link became 101, which was now preferable to the other path. You could have achieved the same thing by setting the cost of the other interface to greater than or equal to 101, giving it a total path cost of greater than or equal to 202, making it less preferred.

Hope that helps - pls rate the post if it does.

Regards,

Paresh

New Member

Re: OSPF external route selection problem

Mike,

If I may pipe in my two bits, once OSPF has selected the best route based on cost and entered this route into the route table, the router examines the destination address of a packet and selects the best path by first, selecting the longest prefix (best-match) and second, pruning the selected entries eliminating less-preferred path types. Path types take the following precedence:

1. Intra-Area

2. Inter-Area

3. E1 External

4. E2 External

In your case, it appears the E1 type metric is equal across both paths, 100. Since both routes are equal then the next criteria is path-type. Intra-area routes are always chosen over Inter-area routes to the same destination.

-m2

New Member

Re: OSPF external route selection problem

Hi there,

In this case when I had the OSPF cost of 100 on the vlan 162 interface I had a situation where a route (192.168.33.0/24) learned from vlan 162 would be intra-area and a cost of 100. This same route learned from vlan 168 would be inter-area with a cost of 2. Shouldn't the router have picked the intra-area route even though the cost was higher than the inter-area one?

Mike

Purple

Re: OSPF external route selection problem

Ok, I get what you mean...

No, that is not quite how OSPF works...

The route under consideration is an external route. When determining the distance to the ASBR that advertised the route, all that OSPF cares about initially is the internal metric to the ASBR, regardless of whether it is inter-area or intra-area. If this internal metric turns out to be the same (which was not the case), then (and only then) will OSPF consider whether the path is inter-area or intra-area (Refer to Section 16.4 of RFC2328 - step 6(a) )...

So you see, the circumstance you had did not necessitate the use of route-type to distinguish the two paths...

Hope that helps.

Paresh

New Member

Re: OSPF external route selection problem

I see Paresh...makes total sense now. Thanks for clearing that up for me.

Mike

268
Views
5
Helpful
15
Replies