cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3080
Views
0
Helpful
8
Replies

OSPF conditional default-information originate

gustavoastorres
Level 1
Level 1

Greetings to all,

I looked everywhere for the answer, but couldn't find it. So, maybe someone in the forum can help me out.

We have 2 branches, each with its own Internet router and connected through a MPLS link.

In branch 1, we have a 2 Mbps Internet link (A). In branch 2, we have a 50 Mbps Internet link (B), plus a 2 (C) and 1 Mbps links (D).

Right now, all traffic for both branches comes and goes through B, but I'd like to change metrics in OSPF, so traffic from branch 1 would use A in case B goes down.

I tried to create a route map with different metric values set, depending on the matched output interface, and asociate it to the default-information originate and redistribute static statements, but had no result (or nasty ones).

Please, does anyone knows how to approach this problem?

Thank you all, and have a great afternoon.

Cheers,

Gustavo.

1 Accepted Solution

Accepted Solutions

Hello Gustavo,

try adding a match ip address for the default route IPv4 prefix

like

ip prefix-list ONLY-DEFAULT permit 0.0.0.0/0

route-map GW permit 10

match ip address prefix ONLY-DEFAULT

match ip next-hop 10

set metric 1

route-map GW permit 20

set metric 50

The second block can be simplified as described above

The reason is that the ip next-hop is an attribute of an IP route so we need also to match on the prefix to be able to check the IP next hop.

Hope to help

Giuseppe

View solution in original post

8 Replies 8

mvsheik123
Level 7
Level 7

Hi Gustavo,

Branch1 - how the default route towards 50Meg internet populated? It is via static route config (ip route 0.0.0.0 0.0.0.0 next hop)? If that is the case, you may want to look into 'IP SLA' traking feature. It worked perfect for me with static routes in place. Check the below link..

https://supportforums.cisco.com/docs/DOC-6078

hth

MS

Hi MS, thank you for your answer.

The default route to B is propagated through "default-information originate" in "router ospf", in router 2. In router 1, we have "default-information originate metric 50", so traffic flows to router 2.

IP SLA is good idea, but then I'd have to use it in other parts of the network. I was thinking of using OSPF with dynamic costs for default route.

Example for router 2:

--

router ospf 2

  ...

  default-information originate route-map DR

route-map DR permit 10

  match interface f0/0 <-- B

  set metric 1

route-map DR permit 20

  match interface f0/1 <-- C

  set metric 50

route-map DR permit 30

  match interface s0/0/0 <-- D

  set metric 60

--

But it seems the route-map is used only for matching, not setting.

Cheers,

Gustavo.

Hi Gustavo,

I guess OSPF conditional default route may help. Check this link.

http://packetlife.net/blog/2008/dec/12/ospf-conditional-default-route-injection/

hth

MS

Hello Gustavo,

I was able to do it successfully by matching on IP next-hop, in my case I was learning a default route from different eBGP sessions and I wanted like you to differentiate the seed metric depending on which eBGP neighbor = next-hop was providing the default route in BGP

under route-map use

access-list 11 permit host 192.168.1.1

route-map SET-SEED permit 10

match ip next-hop 11

set metric 1

route-map SET-SEED permit 20

match ip next-hop 12

set metric 20

....

You will need an access-list for each net-hop in each  route-map clause.

Hope to help

Giuseppe

Thank you for your response, Giuseppe.

Well, I tried it your way, but it seems OSPF doesn't handle it nicely. I create the following:

--

access-list 10 permit host 1.1.1.1 <-- s0/0/0 gateway

access-list 11 permit any <-- any other gateway

route-map GW permit 10

match ip next-hop 10

set metric 50

route-map GW permit 20

match ip next-hop 11

set metric 1

router ospf 2

default-info originate metric-type 1 route-map GW

--

The end result was no E1 LSA visible in neighboring routers for 0.0.0.0 from this router. (!!!)

Maybe I'm doing something wrong ...

Hello Gustavo,

try adding a match ip address for the default route IPv4 prefix

like

ip prefix-list ONLY-DEFAULT permit 0.0.0.0/0

route-map GW permit 10

match ip address prefix ONLY-DEFAULT

match ip next-hop 10

set metric 1

route-map GW permit 20

set metric 50

The second block can be simplified as described above

The reason is that the ip next-hop is an attribute of an IP route so we need also to match on the prefix to be able to check the IP next hop.

Hope to help

Giuseppe

Hello Giuseppe,

You nailed it. Works like a charm.

Since I use a mix of DHCP-based and interface-based default routes, this is my final (partial) config for router 2:

--

ip prefix-list ONLY-DEFAULT permit 0.0.0.0/0

router ospf 2

...

default-information originate metric-type 1 route-map DEFAULT

route-map DEFAULT permit 10

match ip address prefix-list ONLY-DEFAULT

match interface Serial0/0/0

set metric 11

route-map DEFAULT permit 15

match ip address prefix-list ONLY-DEFAULT

match interface Dialer1

set metric 31

route-map DEFAULT permit 20

set metric 1

--

Thank you all very much for your help.

Hello Gustavo,

I have had the solution working for years in a mobile ISP backbone network, but it has been some years ago.

thanks for your kind rating

Best Regards

Giuseppe