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. And see here for current known issues.

New Member

HQ to DR Preferred route, BGP OSPF

Our HQ to DR connection has a point to point DS3 and a connection via MPLS.

HQ has the DS3 and 6 T1s multilinked into the MPLS cloud.

DR has the DS3 and a T1 into the cloud.

There is BGP configured between the two sites and each site is distributing the local OSPF routes into the BGP.

Both HQ and DR are doing mutual distribution of BGP and OSPF.

HQ has this in the BGP config:

distance bgp 150 200 201

The HQ site preferrs the MPLS cloud for all remote branches, but preferrs the DS3 for the HQ subnets.

I want to know why this is happeneing, I see nothing in the config that would point to costing on the interfaces.

Is the cost from the OSPF config being distributed into BGP also and due to the serial interface being 45Mps on the DS# making this the preferred route to DR?

The serial iterface is subinterfaced.

interface Serial1/0

no ip address

encapsulation frame-relay IETF

ip route-cache flow

load-interval 30

dsu bandwidth 44210

framing c-bit

cablelength 50

clock source internal

serial restart-delay 0

frame-relay lmi-type ansi

frame-relay intf-type dce

Serial1/0 is up, line protocol is up

Hardware is M1T-T3+ pa

Description: connected to MCI DS3 Disaster Recovery

MTU 4470 bytes, BW 44210 Kbit, DLY 200 usec,

reliability 255/255, txload 27/255, rxload 2/255

Does this set the Bandwiith on the interface:

dsu bandwidth 44210

30 REPLIES
Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

The HQ site preferrs the MPLS cloud for all remote branches, but preferrs the DS3 for the HQ subnets.

I want to know why this is happeneing, I see nothing in the config that would point to costing on the interfaces.

Very hard to tell without seeing the BGP configuration but one thing I can tell you, BGP does not rely on IGP metrics to select a path in the network.

Please read the following article for understanding on BGP Best Path algorithm

http://www.cisco.com/warp/public/459/25.shtml

Your BGP routers are configured a certain way to choose one link over the other.

HTH,

__

Edison.

New Member

Re: HQ to DR Preferred route, BGP OSPF

sorry

"The HQ site preferrs the MPLS cloud for all remote branches, but preferrs the DS3 for the HQ subnets. "

This should be:

The HQ site preferrs the MPLS cloud for all remote branches, but preferrs the DS3 for the DR subnets.

Here is the BGP config for the edge router to the DR site.

There is a multilink to the MPLS cloud that has a link to DR and the serial interface for the DS3.

The 192.168.2.66 is the serial interface for the DS3.

The 1.2.1.29 is the multilink to the MPLS cloud, that goes to DR.

All subnets to DR have the next hop as 192.168.2.65, which is the DS3 interface on the DR router.

See anything that makes the DS3 preferred?

router bgp 65001

no synchronization

bgp log-neighbor-changes

network 0.0.0.0

network 10.1.0.0 mask 255.255.0.0

network 172.16.254.1 mask 255.255.255.255

redistribute static route-map STATICtoBGP

redistribute ospf 1 match internal external 2

neighbor 192.168.2.66 remote-as 65011

neighbor 192.168.2.66 version 4

neighbor 192.168.2.66 soft-reconfiguration inbound

neighbor 1.2.1.29 remote-as 65000

neighbor 1.2.1.29 version 4

neighbor 1.2.1.29 soft-reconfiguration inbound

distance bgp 150 200 201

no auto-summary

Bronze

Re: HQ to DR Preferred route, BGP OSPF

Hi there,

I think that HQ prefers the MPLS cloud for all remote branches is because is has the smaller AS path attribute.

Secondly, when redistributing OSPF into BGP, the cost is transferred into the Metric attribute of BGP (or MED - Multiple Exit Discriminator). To see that I think the command is "show ip bgp 10.x.x.0" from memory.

The distance bgp 150 200 201 is changing the administrative distance of external bgp, internal bgp and local. Which means that when there is a choice between OSPF (admin distance of 110) and external BGP (usually admin distance of 20, but now 150) the router would choose OSPF.

I hope I've helped and answered your questions to your satisfaction champ!

Brad

Re: HQ to DR Preferred route, BGP OSPF

As Edison points out, Administrative distance does not play a part with BGP path selection

Have a look at this discussion.

http://forums.cisco.com/eforum/servlet/NetProf?page=netprof&forum=Network%20Infrastructure&topic=Routing%20and%20Switching&CommCmd=MB%3Fcmd%3Ddisplay_location%26location%3D.1dda2f44

HTH

Narayan

Bronze

Re: HQ to DR Preferred route, BGP OSPF

I agree, but what gets installed into the routing table does..

New Member

Re: HQ to DR Preferred route, BGP OSPF

I have read all of the replys and the other thread and I still do not see it.

Here is the output of a couple of the related "sh" commands to one of the DR subnets.

This shows weight the same on both paths, local preference is the same on both paths, the only thing I see that is different is metric (not supposed to matter) and the preferred path is 2, the other path shows nothing.

The only thing I see in HQ and DR BGP config is that the remote-as is higher for the DS3 path than the MPLS path.

The MPLS cloud remote-as is 65000 for both DR and HQ.

The HQ router, the remote-as for DR via DS3 is 65011

The DR router, the remote-as for HQ vis DS3 is 65001.

Here is some information from the GQ edge router for a DR subnet:

#sh ip bgp

BGP table version is 4279, local router ID is 172.16.2.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

* 10.100.10.0/24 1.2.1.29 0 65000 65011 ?

*> 192.168.2.66 2 0 65011 ?

#sh ip bgp 10.100.40.0/24

BGP routing table entry for 10.100.40.0/24, version 89

Paths: (2 available, best #2, table Default-IP-Routing-Table)

Advertised to update-groups:

1

65000 65011, (received & used)

1.2.1.29 from 1.2.1.29 (1.24.1.128)

Origin incomplete, localpref 100, valid, external

65011, (received & used)

192.168.2.66 from 192.168.2.66 (172.16.2.5)

Origin incomplete, metric 2, localpref 100, valid, external, best

#sh ip route 10.100.40.0

Routing entry for 10.100.40.0/24

Known via "bgp 65001", distance 150, metric 2

Tag 65011, type external

Redistributing via ospf 1

Advertised by ospf 1 subnets

Last update from 192.168.2.66 7w0d ago

Routing Descriptor Blocks:

* 192.168.254.66, from 192.168.2.66, 7w0d ago

Route metric is 2, traffic share count is 1

AS Hops 1

Route tag 65011

Does anyone see anything the would answer this, or is it obvious and I missed it?

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

Based on your output you have 2 BGP routes in the table for network 10.100.40.0/24.

Looking at the output closer, it 'almost' look identical but let me help you spot the difference

65000 65011, (received & used)

1.2.1.29 from 1.2.1.29 (1.24.1.128)

Origin incomplete, localpref 100, valid, external

65011, (received & used)

192.168.2.66 from 192.168.2.66 (172.16.2.5)

Origin incomplete, metric 2, localpref 100, valid, external, best

Notice how the last entry only has one AS in the path vs the first entry with 2 AS's in the path?

The link I referred in the first post explains the BGP Best Path selection. Take a moment to read it, please :)

New Member

Re: HQ to DR Preferred route, BGP OSPF

Edison,

I really appreciate your reply and knowlege.

I laughed when I saw your smiley face.

I will read it again and see if it sinks in, but sometiems it is like getting through lead.

Thanks for pointing out the difference.

New Member

Re: HQ to DR Preferred route, BGP OSPF

Edison,

Wouldn't the shortest AS-Path be like hop count?

BGP is counting hops?

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

Not really. If you have an iBGP peer the AS_PATH remains the same but you are one hop away :)

You can consider the AS_PATH a 'hop count' only between eBGP routers.

__

Edison.

New Member

Re: HQ to DR Preferred route, BGP OSPF

On my example is the "external" shown here designating the "e" in the eBGP router that you are talking about?

If so, why are they considered external?

65000 65011, (received & used)

1.2.1.29 from 1.2.1.29 (1.24.1.128)

Origin incomplete, localpref 100, valid, external

65011, (received & used)

192.168.2.66 from 192.168.2.66 (172.16.2.5)

Origin incomplete, metric 2, localpref 100, valid, external, best

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

eBGP peering is considered any neighbor that does not belong to the same AS.

For instance, if you have a router with BGP AS 65000 and peer with another router with BGP 65000, that's considered an iBGP peering.

While if you have a router with BGP 65001 peering with another router with BGP 65000, that's considered an eBGP peering.

New Member

Re: HQ to DR Preferred route, BGP OSPF

Edison,

When having both OSPF and BGP doing mutual distribution from each other,

BGP would show all routes in the OSPF route table as being BGP routes, and conversly, all BGP routes would be in the OSPF route table.

If My HQ edge router is the one doing the distribution, will the distributed routes only show up in the routers adjacent to the edge router, or should they show up in the Edge router as well?

And what prevents the router (doing the mutual distribution) from continually distributing routes into each other and going into some type of runaway conditon?

Re: HQ to DR Preferred route, BGP OSPF

Best thing is to avoid Mutual redistribution altogether. Distribute ospf into BGP and use network statement under BGP (we do something similar in our network)

If mutual redistribution is a must, you need to setup filters in such a way that a ospf learnt route is not injected back into OSPF via BGP and vice versa

HTH

Narayan

New Member

Re: HQ to DR Preferred route, BGP OSPF

Thanks for the reply,

I see no filtering and ours does not seem to have any problems at the moment.

Below is out config on the edge router:

router ospf 1

router-id 10.5.70.1

log-adjacency-changes

redistribute static subnets route-map STATICtoOSPF

redistribute bgp 65001 subnets

passive-interface Loopback0

network 10.1.7.0 0.0.0.255 area 0

network 172.16.1.1 0.0.0.0 area 0

default-information originate

!

router bgp 65001

no synchronization

bgp log-neighbor-changes

network 0.0.0.0

network 10.1.0.0 mask 255.255.0.0

network 10.1.7.0 mask 255.255.255.0

network 10.50.0.0 mask 255.255.0.0

network 172.16.1.1 mask 255.255.255.255

redistribute static route-map STATICtoBGP

redistribute ospf 1 match internal external 2

neighbor 1.1.254.66 remote-as 65011

neighbor 1.1.254.66 version 4

neighbor 1.1.2.66 soft-reconfiguration inbound

neighbor 1.2.1.29 remote-as 65000

neighbor 1.2.1.29 version 4

neighbor 1.2.1.29 soft-reconfiguration inbound

distance bgp 150 200 201

no auto-summary

Can you show me an example of how you have your mutual distribution filtered?

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

If My HQ edge router is the one doing the distribution, will the distributed routes only show up in the routers adjacent to the edge router, or should they show up in the Edge router as well?

Sorry, I don't understand this question.

If the HQ Edge Router is doing the resdistribution, all routers running the same protocol as the HQ Edge Router will receive those routes unless they are filtered.

When performing redistribution, you always run into the risk of creating a route-loop. It's very hard to determine if you are going to encounter a route-loop without viewing the whole network topology.

It would be ideal if you can provide a diagram depicting the whole routing topology.

__

Edison.

New Member

Re: HQ to DR Preferred route, BGP OSPF

Here is a drawing with OSPF/BGP config shown.

My question regarding the Distribution, was would I see the routes as distributed in the current route tables in the 7206 and the 3725 edge routers, or would they only show up in the adjacent routers with the edge routers only doing the distribution?

For example if the 7206 is distributing the DR BGP subnets into OSPF, would I see that in the 7206 route tables.

Looking at the 7206, it looks like I can see the OSPF database showing the BGP routes, so the answer would be the 7206 does actually have the routes in it's own database.

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

At HQ, the 7206 will the routes coming from DR and "typical branch" as BGP.

At HQ, routers sitting behind the 7206 will see those routes as 'redistributed OSPF routes' (E1 or E2).

Same theory holds for the 3725 router sitting at the DR site.

HTH,

__

Edison.

New Member

Re: HQ to DR Preferred route, BGP OSPF

Thanks for the reply.

With what I have shown you, do you think there is a need for filtering?

For example, why doesn't the mutual ditribution cause reditribution from one protocol to the other,

then re-redistribution

then re-re-redistribution?

Is there a mechanism (lacking a better word) to prevent these endless loops of distributing?

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

No, you don't need filtering as there isn't any concern for route-loops.

There is only one way to get into HQ and DR, that is - via the 7206 and 3725 respectively.

BGP routes are coming from the external networks and brought into OSPF for internal routing.

OSPF routes are coming from the internal networks going out as BGP routes.

This is standard practice on 95% of networks out there, that is, BGP being redistributed into an IGP.

HTH,

__

Edison.

New Member

Re: HQ to DR Preferred route, BGP OSPF

Thanks edison,

Since I have your attention a couple more questions:

What about the redistribution?

What prevents OSPF from distributing the routes into BGP and since BGP is distributing routes into OSPF, to redistribute the distributed routes again and again and again?

Am I not thinking of this correctly?

It seems something would have to prevent that from happening?

Also, what is the benifit to using BGP at the remote branches and OSPF locally?

It seems the convergence time is longer with BGP route tables.

Why not just use OSPF in the remote branches as well as in the local infrastruvture?

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

What prevents OSPF from distributing the routes into BGP and since BGP is distributing routes into OSPF, to redistribute the distributed routes again and again and again?

Nothing prevents a routing protocol from being redistributed into another. However, per your diagram, that's not the case. You have a single point of redistribution at each location and it does not create a loop. If you were to have multiple points on redistribution on a single location, then added measures must be taken to avoid a loop. That's not the case here :)

It seems something would have to prevent that from happening?

You can implement some kind of route tagging as the routes are being brought from one protocol to another and if those routes were to encounter another point of redistribution, you can configure that router NOT to redistribute those routes based on a specific tag.

Again, not the case here based on your diagram.

Also, what is the benifit to using BGP at the remote branches and OSPF locally?

It seems the convergence time is longer with BGP route tables.

Why not just use OSPF in the remote branches as well as in the local infrastruvture?

Very good question and the answer depends on the network design and needs. BGP offers you granular routing policies and independent Autonomous System.

OSPF is an IGP and any changes in the OSPF routing table, affects everyone running the protocol.

HTH,

__

Edison.

New Member

Re: HQ to DR Preferred route, BGP OSPF

Edison, maybe I am not understanding here, and this is something I have wondered about, maybe I am not making sense.

I am wondering about the distribution in my case:

If I have BGP routes from my remote sites and they are distributed into OSPF in my edge router,

Since my edge router will have both BGP and OSPF, the BGP routes are now in OSPF from the BGP to OSPF distribution.

OSPF is distributing the same routes that were distributed from BGP back into into BGP again.

How does the router know to not go into some uncontrollable runnaway?

How does the router know to do just one distribution of BGP into OSPF and one Distribution of OSPF into BGP and stop there?

It seems that is a circle that could go out of control.

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

The router performing the redistribution will see the BGP routes as BGP and the OSPF routes as OSPF.

Yes, the BGP routes will be in OSPF only on devices sitting behind this router. The router doing the redistribution won't change these routes on its own routing table.

For instance, perform a show ip route x.x.x.x and replace the x's for a network originated from the DR site at the 7200 router. Those routes will be shown as BGP while if you do the same in a router sitting behind the 7200 at HQ, those routes will be shown as OSPF.

Now, check for routes originate in OSPF in this same router, it will only show in the routing table as OSPF, not as BGP. Therefore, when performing a redistribution, the router check its routing table and brings the routes that matches the redistributed protocol.

HTH,

__

Edison.

New Member

Re: HQ to DR Preferred route, BGP OSPF

Edison thanks for the reply, don't give up on me yet.

This is an excellent source to learn from.

Here is an output that seems to add confusion.

My original thought during the explanations was that the distributING router did not have the distrubtED routes, which would answer the question about the runaway condition I asked about.

But earlier duing the post, I did check the DR route in OSPF database and see what I think is the route distributed from BGP on the same router, the reason fror my continued questions on this.

Perhaps you can show me what I am missing or misunderstanding.

Shown is the OSPF database of the route for the subnet residing in DR, and the BGP route as well, on the router doing the distribution, the 7206 edge to DR. The 10.5.70.1 is the router ID in OSPF for this router:

#sh ip route 10.100.4.0

Routing entry for 10.100.4.0/24

Known via "bgp 65001", distance 150, metric 2

Tag 65011, type external

Redistributing via ospf 1

Advertised by ospf 1 subnets

Last update from 1.1.254.66 1d00h ago

Routing Descriptor Blocks:

* 1.1.254.66, from 1.1.254.66, 1d00h ago

Route metric is 2, traffic share count is 1

AS Hops 1

Route tag 65011

#sh ip ospf database external 10.100.4.0

OSPF Router with ID (10.5.70.1) (Process ID 1)

Type-5 AS External Link States

LS age: 725

Options: (No TOS-capability, DC)

LS Type: AS External Link

Link State ID: 10.100.4.0 (External Network Number )

Advertising Router: 10.5.70.1

LS Seq Number: 8000002D

Checksum: 0x7038

Length: 36

Network Mask: /24

Metric Type: 2 (Larger than any link state path)

TOS: 0

Metric: 1

Forward Address: 0.0.0.0

External Route Tag: 65011

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

When performing redistribution, the redistributing router only looks at its routing table, NOT the particular protocol database (on this case OSPF).

The OSPF database is useful as you can verify the route is indeed being advertised out to OSPF neighbors (remember,all OSPF speaking routers running in the same area must have identical databases). However, if the route does not show as an OSPF route while issuing "show ip route x.x.x.x", then on that particular router, the route isn't treated as OSPF. As per your example, the route 10.100.4.0 is a BGP route and is being Redistributing via ospf 1.

__________

#sh ip route 10.100.4.0

Routing entry for 10.100.4.0/24

Known via "bgp 65001", distance 150, metric 2

Tag 65011, type external

Redistributing via ospf 1

Advertised by ospf 1 subnets

Last update from 1.1.254.66 1d00h ago

Routing Descriptor Blocks:

* 1.1.254.66, from 1.1.254.66, 1d00h ago

Route metric is 2, traffic share count is 1

AS Hops 1

Route tag 65011

_________

HTH,

__

Edison.

New Member

Re: HQ to DR Preferred route, BGP OSPF

Excellent replys edison.

You have answered numerous questions that have been bugging me.

Thank you so much!

I have more questions regarding what I see in the above outputs if you are up for it.

If not, I understand.

Hall of Fame Super Bronze

Re: HQ to DR Preferred route, BGP OSPF

Ask away :)

New Member

Re: HQ to DR Preferred route, BGP OSPF

On the "routing descriptor blocks" below,

This line is telling me (from the star)that it is the best route to 10.100.40.0, is that correct?

In BGP, if there were numerous routes, would they show us as well with the asterisc route?

Why is the route metric 2?

#sh ip route 10.100.4.0

Routing entry for 10.100.4.0/24

Known via "bgp 65001", distance 150, metric 2

Tag 65011, type external

Redistributing via ospf 1

Advertised by ospf 1 subnets

Last update from 1.1.254.66 1d00h ago

Routing Descriptor Blocks:

* 1.1.254.66, from 1.1.254.66, 1d00h ago

Route metric is 2, traffic share count is 1

AS Hops 1

Route tag 65011

On the below output, is the "LS Type: AS External Link" derived from the route being a distributed route?

Why is the forwarding address 0.0.0.0?

Where can I find informa on these types of things? There doesn't seem to be any resources on reading the OSPD database.

#sh ip ospf database external 10.100.4.0

OSPF Router with ID (10.5.70.1) (Process ID 1)

Type-5 AS External Link States

LS age: 725

Options: (No TOS-capability, DC)

LS Type: AS External Link

Link State ID: 10.100.4.0 (External Network Number )

Advertising Router: 10.5.70.1

LS Seq Number: 8000002D

Checksum: 0x7038

Length: 36

Network Mask: /24

Metric Type: 2 (Larger than any link state path)

TOS: 0

Metric: 1

Forward Address: 0.0.0.0

External Route Tag: 65011

580
Views
70
Helpful
30
Replies
CreatePlease login to create content