cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3745
Views
10
Helpful
4
Replies

How Gateway of Last Resort is elected in OSPF

EPHRAIM MANI
Level 3
Level 3

Hi  Team, I am trying to identify which once is slected  "Gateway of last resort is 0.0.0.0 to network 0.0.0.0" is elected by a stub area router (R3)assuming all the configuration are default. have snipped a lay out and configuration for your perusal.

ABR/ASBR (R1)    ABR/ASBR (R2)

int fa0/0 |                    | intfa0/1

                |                  |

                   |              |

          fa0/0    |       |   fa0/1

             NSSA router (R3)

R1

router ospf 1
 router-id 25.1.1.1
  area 1 nssa default-information-originate

R2

router ospf 1
 router-id 21.1.1.1
 area 1 nssa default-information-originate

R3

router ospf 1
 log-adjacency-changes
 area 1 nssa
R3#

Thanks in advance for this quick brainstormin

~EM

4 Replies 4

Rolf Fischer
Level 9
Level 9

Hello,

the default-route injection is conditional on both R1 and R2, so both need to have a default-route in their routing-tables.

The default type of (NSSA) external LSAs is E2 (N2), that means that the first step in the selection process compares their metrics. In this case both are equal (default value); you could change that with the "metric <value>" keyword. The next step is the comparsion of the pathcosts to the Forwarding Addresses of the respective LSAs. Forwarding Addresses are often Zero (0.0.0.0), in such cases the pathcosts to the ASBRs are compared instead, but in the case of NSSAs they have to be non-Zero.

So we need to look at the Forwarding Addresses with the following command

  • show ip ospf database nssa-external 0.0.0.0

and then do two routing-table lookups on R3

  • show ip route <Forwarding Address R1>
  • show ip route <Forwarding Address R2>

The lower cost win; when the costs are equal, the router will perform equal cost load sharing.

When you do a "show ip route 0.0.0.0" you should see a "forwarding metric", this is the pathcost to the Forwarding Addresss.

HTH
Rolf

Hi Rof,

Thanks for respoding to the post..

R3# sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is 2.2.2.1 to network 0.0.0.0

1.0.0.0/30 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, FastEthernet0/0
2.0.0.0/30 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, FastEthernet0/1
100.0.0.0/30 is subnetted, 1 subnets

R3#sh ip route 2.2.2.1
Routing entry for 2.2.2.0/30
Known via "connected", distance 0, metric 0 (connected, via interface)
Routing Descriptor Blocks:
* directly connected, via FastEthernet0/1
Route metric is 0, traffic share count is 1

R3#sh ip route 1.1.1.1
Routing entry for 1.1.1.0/30
Known via "connected", distance 0, metric 0 (connected, via interface)
Routing Descriptor Blocks:
* directly connected, via FastEthernet0/0
Route metric is 0, traffic share count is 1

R3#

i am curious as to what constitute to select "Gateway of last resort is 2.2.2.1 to network 0.0.0.0" 2.2.2.1 as gateway of last of resort, the cost to the forwarding address are equal.

Thanks in advance for the brainstorming.

~EM

in continuation few more logs

R3# sh ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
Known via "ospf 1", distance 110, metric 1, candidate default path, type NSSA extern 2, forward metric 1
Last update from 2.2.2.1 on FastEthernet0/1, 01:21:17 ago
Routing Descriptor Blocks:
* 2.2.2.1, from 21.1.1.1, 01:21:17 ago, via FastEthernet0/1
Route metric is 1, traffic share count is 1
1.1.1.1, from 25.1.1.1, 01:21:17 ago, via FastEthernet0/0
Route metric is 1, traffic share count is 1

R3#

First, just for the sake of completeness, regarding the Forwarding Addresses we have a special case here, since they both belong to R3's connected networks. That's why a "show ip route <Forwarding Address>" is not very useful here. We can see two equal cost routes with a forward metric of 1 in the "show ip route 0.0.0.0" output. To compare forwarding metrics you would need to use "show ip ospf rib" (if supported) or "show ip ospf border-routers" in such a case.

Anyway, the routing-table shows two equal cost default-routes and your question is why the "Gateway of last resort ..." line shows only one of them, right? Unfortunately I don't know the logic behind the selection; when playing around with gns3 it seemed to always prefer the higher IP address. But I'm not sure if this behavior also depend on the IOS version.

HTH
Rolf

Review Cisco Networking products for a $25 gift card