Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

BGP path slection issue

Hi,

I have 3 routers A,B,C connectied in Triangle running IBGP between router B,router c. and ebgp with router A.Router A on top have BGP peer with AS 34846(ISP 1) and B,C have bgp peer with AS 3356(ISP2) ,All user are connected through router B and C.

I made the chage below on router B to preffer AS 34846 towards router A for prefix 43.252 4.0/22, but still Prefer path is AS 3356. All 3 routers gets 0/0 route from my both ISP. Please advise.

router bgp 10753

no synchronization

bgp log-neighbor-changes

network 43.252.0.0 mask 255.255.252.0

network 43.252.4.0 mask 255.255.252.0

network 43.252.156.0 mask 255.255.252.0

neighbor 43.252.0.6 remote-as 34846

neighbor 95.50.116.53 remote-as 3356

neighbor 43.252.0.6 route-map LP in

neighbor 43.252.0.6 route-map AS out

maximum-paths 3

default-metric 100

no auto-summary

ip access-list standard LP

permit 43.252.4.0 0.0.3.255

permit 43.252.8.0 0.0.3.255

permit 43.252.156.0 0.0.3.255

route-map AS permit 10

match ip address LP

set as-path prepend 10753 10753 10753 10753

!

route-map AS permit 20

route-map LP permit 10

match ip address LP

set local-preference 200

!

route-map LP permit 20

W8-7200-CC-1#sh ip bgp

BGP table version is 140628,

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

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

Network Next Hop Metric LocPrf Weight Path

* 0.0.0.0 43.252.0.6 0 34846 4589 i

*> 95.50.16.53 0 3356 i

* 43.252.4.0/22 43.252.0.6 25625856 200 0 34846 i

*> 0.0.0.0 100 32768 i

*> 43.252.12.0/24 43.252.0.6 0 0 34846 i

*> 43.252.152.0/22 43.252.1.250 100 32768 i

* 43.252.156.0/22 43.252.0.6 25625856 200 0 34846 i

*> 0.0.0.0 100 32768 i

13 REPLIES
Cisco Employee

Re: BGP path slection issue

Hi,

Can you please rephrase your requirements?

Like "traffic towards 43.252.4.0/22 should go through ..." or "return traffic to ... should arrive via ISP ...". Currently I do not understand your requirements. On top it would be very helpful to get router A?s BGP config and respective BGP table.

Regards, Martin

New Member

Re: BGP path slection issue

Thanks in advance,

I have 3 routers A,B,C connectied in Triangle ,ebgp running between A->C and A->B.Router A on top have BGP peer with AS 34846(ISP 1) and B,C have bgp peer with AS 3356(ISP2) ,All user are connected through router B and C.

I made the chage below on router B to preffer AS 34846 towards ISP1 for prefix 43.252 4.0/22, but it still Preferring path AS 3356 ISP2. All 3 routers gets 0/0 route from my both ISP.

I would like traffic for prefix 43.252.4.0/22 in and out through ISP1 which is peer on router A.

Bit correction with previous config on router B

neigh 95.50.116.53 route-map AS out

Config for router A

router bgp 34846

no synchronization

bgp log-neighbor-changes

network 43.252.12.0 mask 255.255.255.0

network 43.252.4.0 mask 255.255.252.0

neighbor 89.200.130.48 remote-as 4589

neighbor 89.200.130.48 route-map LOCAL_PREF in

neighbor 43.252.0.5 remote-as 10753 <---------peer with router B

neighbor 43.252.0.9 remote-as 10753 <----------peer with router C

maximum-paths 2

no auto-summary

!

ip classless

ip route 43.252.12.0 255.255.255.0 Null0

ip route 43.252.4.0 255.255.255.0 Null0

no ip http server

!

!

ip access-list standard NETOUT

permit 43.252.4.0 0.0.3.255

permit 43.252.12.0 0.0.0.255

!

route-map LOCAL_PREF permit 10

match ip address name NETOUT

set local-preference 200

!

route-map LOCAL_PREF permit 20

!

regards,

Cisco Employee

Re: BGP path slection issue

Hi,

So you only get default routes but would like to influence traffic for 43.252.4.0/22 specifically through ISP1?

If you do not own 43.252.4.0/22 yourself and this is an internet prefix then the cleanest approach would be to get 43.252.4.0/22 announced by ISP1, as then the longest match would sort out all your issues.

In case this is not possible, you could use a static route in router A towards ISP1 and insert insert it into BGP. Remove all network statements in router B and C with respect to 43.252.4.0/22 and make sure you do not announce the prefix to the internet.

Currently router B prefers the locally inserted prefix because of the weight 32768 set per default. Removing all network statements in router B would remove this issue.

In case you own 43.252.4.0/22 then use your IGP to internally route to the proper destination and use AS path prepending towards your ISPs to influence the return path.

Hope this helps! Please rate all posts.

Regards, Martin

New Member

Re: BGP path slection issue

I have also posted the same on the other forum but the issue is confusing as you seem to be saying your accepting the prefix form a peer and you want to local preference it and then equally in the same config your originating the prefix by adding the null0 static route and BGP network statement.

What are you doing advertising it or accepting it in ?

New Member

Re: BGP path slection issue

Hi,

I am accepting this from B on router A , so I have removed from the config.

no network 43.252.4.0 mask 255.255.252.0

no ip route 43.252.4.0 255.255.252.0 null0

now prefix 43.252.4.0/22 is coming from router B on A.I like this to go through Isp1 on router A and isp2 on router B as 2nd prefer path.

Also there is ebgp between router A and B.

Please advice.

regards,

New Member

Re: BGP path slection issue

Hi

to add more ,43.252.4.0/22 is advertised on router B in BGP , because I have users on this subnet connect by swith which connect to router B.if I remove network command under BGP then it will stop advertising to ISP2 as well on router B , will not I lose internet connection ?.

New Member

Re: BGP path slection issue

If your are the owner of that subnet and originating then yes. You will need the network statement and null0 setup.

If you own all three routers you need to setup iBGP between them all so influence the selection within the AS.

Silver

Re: BGP path slection issue

Hi. It seems all wrong to me - i.e. the configuration is reversed.

IF you want prefix 43.252.4.0 0.0.3.255 to be preferred through AS 3356, you need to increase local preference for 3356, and increase AS_PATH length for AS 34846.

What you did is the exact opposite.

Referring to your original configuration, you should have the following:

neighbor 95.50.116.53 route-map LP in (this will increase local preference for all routes received from AS 3356 and therefore make them preferable)

and also

neighbor 43.252.0.6 route-map AS out

This command will make return path from as 34846 less preferable. Therefore outgoing and return traffic for 43.252.4.0 will be prefered through AS 3356.

Commands "neighbor 43.252.0.6 route-map LP in " and "neighbor 95.50.116.53 route-map AS ouot" are doing the exact opposite of what you require.

Hope this helps.

New Member

Re: BGP path slection issue

HI,

thanks for all but I am still not able to make it work,

I have redone the config as below.

Only i want to do is prefix 43.252.4.0/22 which is connected on router B and C will prefer ISP2 for in/out traffic and ISP1 as backup.I own these 3 routers and prefix 43 and also own 2 diffrent local AS 10753 on router B&C and AS 34846 on router A, and this cant be changed.

Please advice.

Config for router A

router bgp 34846

no synchronization

bgp log-neighbor-changes

neighbor 89.200.130.48 remote-as 4589 <--------ISP2

neighbor 43.252.0.5 remote-as 10753 <---------peer with router B

neighbor 43.252.0.9 remote-as 10753 <----------peer with router C

maximum-paths 2

no auto-summary

---------------------------------------------------------------

RouterB config

router bgp 10753

no synchronization

bgp log-neighbor-changes

network 43.252.4.0 mask 255.255.252.0

neighbor 43.252.0.6 remote-as 34846 <------PEER WITH ROUTERA

neighbor 95.50.116.53 remote-as 3356 <----ISP1

maximum-paths 3

default-metric 100

no auto-summary

IP ROUTE 143.252.4.0 255.255.252.0 NULL0

------------------------------------------

ROUTER C CONFIG

router bgp 10753

no synchronization

bgp log-neighbor-changes

network 43.252.4.0 mask 255.255.252.0

neighbor 43.252.0.10 remote-as 34846 <-----PEER WITH ROUTER A

neighbor 95.50.116.100 remote-as 3356 <---ISP1

maximum-paths 3

default-metric 100

no auto-summary

IP ROUTE 143.252.4.0 255.255.252.0 NULL0

New Member

Re: BGP path slection issue

I assume the ip route 143.x.x.x should be 43.x.x.x

I still recommend iBGP between the two B and C routers for attributes to be shared between them.

You will have to as prepend on B and C to your ISP to depref that route (43.x.x.x) and you will have to setup a local preference on B and C taking the internet route or default if your not full routing from A so the return path is from A as you dont prepend that peer and outbound is through A as you set an LP on B & C through A.

A should advertise the prefix it receives (43.x.x.x) from B and C normally as long as your upstream ISP is not prefix list preventing it.

I would also recomend setting soft reconfig on peers for ease of filter changes and peer resets.

New Member

Re: BGP path slection issue

hi,

143 is 43,upstream isp2 is recieving 43 prefix with path 34846 10753 .

I am also reciving 0/0 on router A from ISP2 and Router B&C from isp1 and router A.

I can set ibgp between B&C but not with A.

I thought Lcocal_Pref to work you do need ibgp but I am running ebgp between A to B and A to C.

What about changing Weight on B and C for prefix 43.

Regards,

New Member

Re: BGP path slection issue

Local preference is non transative so it stays within an AS but iBGP needs to be setup between B&C. I dont see that in your config. Router A may see BGP from B&C but B&C dont have a neighbor statement to each other with their AS set as the remote AS.

New Member

Re: BGP path slection issue

Agree, I will set the ibgp between B&C.But really I am worried about A and B cos C will be comming off when A start working properly.but I still wont be able to put ibgp between A&B due to 2 diff local AS.

Regards,

184
Views
5
Helpful
13
Replies
CreatePlease to create content