cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
733
Views
10
Helpful
7
Replies

OSPF-Default Route

hclisschennai
Level 1
Level 1

Hi Everybody,

I am testing this setup in a LAB environment.

I have 2 ISPs BSNL & AIRTEL connected to Gateway Router 1 and Gateway Router 2 respectively. I also have 2 Core routers. I am running OSPF in Gateway Router 1, Gateway Router 2, Core Router-1 and Core Router-2.

I configured default-information originate command in both the Gateway Router-1 and Gateway Router-2. It perfectly advertising default routers in Core-1 and Core-2 Routers.

But i want this to work in different way as i will explain now.

1. When Gateway Router 1 advertise default route to Core-1, it should adverise with metric 10 and whereas when it advertise to Core-2 it should advertise with metric 100.

2. When Gateway Router 2 advertise default route to Core-2, it should adverise with metric 10 and whereas when it advertise to Core-1 it should advertise with metric 100.

Thus Core-1 will have default route pointing to Gateway-1 and Core-2 will have default route pointing to Gateway-2

I Hope i tried to explain the scenario in detail.

Looking forward for help

7 Replies 7

lamav
Level 8
Level 8

You've explained yourself well.

Basically, you want C1 to default out to GW1 and use GW2 as a failover.

You want the reverse for C2.

Correct?

Why are you running OSPF on your GW routers anyway? Is it simply so that you can redistribute the default you're learning from the ISPs back to your core?

How are you peering with the ISP? I assume its BGP.

Are these Internet connections or MP-BGP implementations for MPLS VPN, in which you want to extend your OSPF domain across the providers' clouds?

The problem is that you are sharing a common interface with GW1 and GW2 in a multiaccess network, so you dont have the option of manipulating the OSPF cost on a particular interface to make routes learned through one interface more/less desirable than routes learned on other interfaces.

Can I suggest that you not advertise a default route through OSPF and just use 2 statics? It seems like the easiest way to get this accomplished. Is there a reason why this wouldnt work in your network?

C1

ip route 0.0.0.0 0.0.0.0 GW1

ip route 0.0.0.0 0.0.0.0 GW2 220

C2

ip route 0.0.0.0 0.0.0.0 GW2

ip route 0.0.0.0 0.0.0.0 GW1 220

Hi,

Thanks for your comment and yours is the very good choice, even i have the same in my mind too.

But as i mentioned in the post i am doing this in LAB environment. I want to manipulate using OSPF only and i donot want to use static route.

I gateway routers i am using static default route to ISPs. I donot like to redistribute also.

I tried with

"default-information originate route-map TEST-1"

command with ACLs as below

In Gateway Router-1

access-list 1 permit 3.3.3.3

access-list 2 permit 4.4.4.4

route-map TEST-1 permit 10

match ip address 1

set metric 10

route-map TEST-1 permit 20

match ip address 2

set metric 220

where 3.3.3.3 is core-1 and 4.4.4.4 is core-2

Kindly help me where is the mistake?

R.B.Kumar

Hello R.B. Kumar,

you cannot make OSPF to advertise something different to different neighbors it is not BGP.

you can try to influence default gateway choice of core routers using the following tips:

have both ASBR to inject the default route as an O E1 (metric-type 1).

have a topology where different physical or at least logical interfaces are used to connect

ASBR1 to core1 and core2

ASBR2 to core1 and core2

being the metric of type O E1 internal metric plays a role here:

have core1 to increase its OSPF cost of link to ASBR2

have core2 to increase its OSPF cost of link to ASBR1

in this way if both ASBR1 and ASBR2 generate an O E1 default route 0.0.0.0/0 with same seed metric core1 and core2 will use each the path with the lowest cost.

Note: the effect of changing ospf cost on interfaces is global so you need to consider if it is wise to do so by considering the possible side effects

Victor's suggestion is probably the correct one.

You can think of adding tracking to be able to use the backup route in a faster way.

see

http://www.cisco.com/en/US/docs/ios/12_3/12_3x/12_3xe/feature/guide/dbackupx.html

Hope to help

Giuseppe

Hi Giuseeppe,

Your comments are very convincing with the quoutes "you cannot make OSPF to advertise something different to different neighbors it is not BGP"

Thanks, But what for the route-map is used along with "default-information originate" command. I know that one purpose of route-map in the command "default-information originate"

is to verify whether the route entry in the routing table. Is this is the only purpose of using route-map in "default-information originate"

Infact i have tried with route-map as mentioned in the earlier post. But it is not working.

Can you make me to understand why my solution is not working here

R.B.Kumar

Hello R.B.Kumar,

the route-map used in the default-originate command allows some checks and some actions:

the checks can be the presence of some route in the routing table for example.

the route-map allows to set some parameter of the LSA that will represent the default route in the OSPF DB.

the route-map cannot influence how the LSA of type 5 will be flooded:

an OSPF router can send out only one consistent version of an LSA in a given time interval (30 minutes) so there is no way to send two different LSAs one to a neighbor and one to the other.

So whatever test you try to use

match ip address

match ip next-hop

and so on the route-map will be not effective.

Flooding means sent to everyone on every link.

This comes from the link state nature of OSPF.

information has to be consistent all routers need to receive and use the same data structures.

This provides routing loop avoidance.

What you can try to do is to modify the perception of the two ASBRs in the internal routers so that one can prefers ASBR1 and the other can prefer ASBR2.

Hope to help

Giuseppe

Thanks to Victor and Giuseppe,

Now i understand the nature of route-map used in default-information originate command.

But you mentioned the quote

"What you can try to do is to modify the perception of the two ASBRs in the internal routers so that one can prefers ASBR1 and the other can prefer ASBR2"

Can you spare a time to explain what you are trying to communicate in above lines?

regards,

R.B.Kumar

RB:

As Giueseppe has stated, you cannot advertise different metrics for the same destination network to different OSPF neighbors.

The route map you created does half the job: it lets C1 see GW1 as the preferred default, with GW2 as the backup. The problem is those metrics will also be advertised to C2 and he, too, will see GW1 as the preferred and GW2 as the secondary.

This is not BGP , where you can influence how different neighbors view the desirability of the routes you advertise.

Lastly, you will want a mechanism to track GW1's connectivity to the ISP. SO, you should use some tracking. You can get creative with this, too.

HTH

Victor

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco