Routing
Reply
Contributor
Frank-Lu
Posts: 21
Registered: ‎04-08-2009
0
Accepted Solution

Why OSPF external type 2 preferred over external type 1?

I thought the OSPF external type 1 should be preferred than type 2 but the router is choosing the type 2 even with higher metric:

 

>>> OSPF database right after I clear the neighbor:

 

admin@Tokyo> show ospf database external extensive   
    OSPF AS SCOPE link state database
 Type       ID               Adv Rtr           Seq      Age  Opt  Cksum  Len
Extern   0.0.0.0          10.14.10.1       0x80000001     9  0x22 0x709e  36
  mask 0.0.0.0
  Topology default (ID 0)
    Type: 1, Metric: 1, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
  Aging timer 00:59:50
  Installed 00:00:08 ago, expires in 00:59:51, sent 00:00:03 ago
  Last changed 00:00:08 ago, Change count: 1
Extern   0.0.0.0          10.14.14.1       0x80000007     3  0x22 0xad73  36
  mask 0.0.0.0
  Topology default (ID 0)
    Type: 2, Metric: 100, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
  Aging timer 00:59:56
  Installed 00:00:02 ago, expires in 00:59:57, sent 00:00:02 ago
  Last changed 00:00:02 ago, Change count: 11

admin@Tokyo> 

 

 

>>> After few seconds:

 

admin@Tokyo> show ospf database external extensive   
    OSPF AS SCOPE link state database
 Type       ID               Adv Rtr           Seq      Age  Opt  Cksum  Len
Extern   0.0.0.0          10.14.14.1       0x80000007    15  0x22 0xad73  36
  mask 0.0.0.0
  Topology default (ID 0)
    Type: 2, Metric: 100, Fwd addr: 0.0.0.0, Tag: 0.0.0.0
  Aging timer 00:59:44
  Installed 00:00:14 ago, expires in 00:59:45, sent 00:00:14 ago
  Last changed 00:00:14 ago, Change count: 11

admin@Tokyo>

 

Super Contributor
Super Contributor
Ulf
Posts: 141
Registered: ‎11-13-2008
0

Re: Why OSPF external type 2 preferred over external type 1?

Hi,

 

I'm neither very familiar with OSPF nor with the JUNOS implementation, but I think that choosing a route and what's contained in the database is not more connected as to "it can only be choosen what's in the database". In your second output the T1 route isn't shown anymore, therefore I assume it has been removed. Can you please enable traceoptions for database and lsa's or packets to verify that there is or isn't an external reason for this?

 

Best Regards

 

Ulf

If this worked for you please flag my post as an "Accepted Solution" so others can benefit. A kudo would be cool if you think I earned it.
Super Contributor
AntonD
Posts: 111
Registered: ‎11-07-2007

Re: Why OSPF external type 2 preferred over external type 1?

I see that the prefix (default route) is being advertised by 2 different routers. One thing to look for is how the routers are being exported into OSPF. Keep inmind that normally only active routes are exported into OSPF by JUNOS. Also as you are looking at the OSPF database, this is actually before the SPF calculations are done. So no LSA type prefernces have actually been applied yet. My best guess is that the source routers are for some reason not advertising the default router. So have a look at the two routers and check what their routing tables says.
Contributor
Frank-Lu
Posts: 21
Registered: ‎04-08-2009
0

Re: Why OSPF external type 2 preferred over external type 1?

Thanks for the reply... You are right on the spot...

 

The Tokyo's neighbors are learning the 0/0 from BGP then redistributed into OSPF, the neighbor which has type 1 configured has activated 0/0 in OSPF table so is not using the BGP 0/0 and not sending to Tokyo...

 

Now, Tokyo has both type 1 and type 2 0/0 in OSPF database and using the type 1 after I added the OSPF import filter for its neighbors.

 

Thanks for the help!

Contributor
nhnam
Posts: 10
Registered: ‎03-06-2008
0

Re: Why OSPF external type 2 preferred over external type 1?

I have problem same as, but i don't know how to create import filter into ospf . Can you help please
Contributor
nhnam
Posts: 10
Registered: ‎03-06-2008
0

Re: Why OSPF external type 2 preferred over external type 1?

i have created filter import OSPF :

term 1 {
    from {
        external {
            type 1;
        }
    }
    then reject;
}

 

and it's working now

 

Thank you so much for your advisor

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.