cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1071
Views
2
Helpful
11
Replies

BGP route padding on Cisco ASR

maniac79
Level 1
Level 1

Hello, I have two ASR routers running BGP between two connections. I am new to this so please bear with me. Basically we are running BGP at our hub office and would like to pad routes to certain branch offices to connection A or B.

 

Is it possible to say have traffic destined for branch office x to prefer connection B over A?

 

Thank you

1 Accepted Solution

Accepted Solutions

M02@rt37
VIP
VIP

Hello @maniac79 

It's possible to influence traffic flow from the hub office to a specific branch office over a specific connection by adjusting the BGP attributes. One common approach is to use the

local preference

attribute to set a higher preference for the path that leads to the desired connection.

Basic example:

router bgp [your-asn]
neighbor x.x.x.x route-map branch-x-out out
!
route-map branch-x-out permit 10
match ip address prefix-list branch-x
set local-preference 200

In this configuration, the

branch-x-out route-map

is applied to the BGP updates sent to the neighbor with IP address x.x.x.x, which is the neighbor representing connection A or B to the specific branch office. The

route-map matches the prefix-list branch-x

which contains the IP address range for branch office x. The

set local-preference

command increases the local preference value to 200 for these routes, which means that the ASR routers will prefer the path with the highest local preference value to reach that destination.

Default local-preference

is 100 ; path with the 

highest local preference

is prefered.

You will need to repeat this configuration for each neighbor representing each connection to the various branch offices. Keep in mind that other BGP attributes such as AS path length and origin type may also affect route selection, so you may need to adjust those attributes as well to achieve the desired traffic flow.

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

https://www.catchpoint.com/bgp-monitoring/bgp-attributes

 

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

11 Replies 11

M02@rt37
VIP
VIP

Hello @maniac79 

It's possible to influence traffic flow from the hub office to a specific branch office over a specific connection by adjusting the BGP attributes. One common approach is to use the

local preference

attribute to set a higher preference for the path that leads to the desired connection.

Basic example:

router bgp [your-asn]
neighbor x.x.x.x route-map branch-x-out out
!
route-map branch-x-out permit 10
match ip address prefix-list branch-x
set local-preference 200

In this configuration, the

branch-x-out route-map

is applied to the BGP updates sent to the neighbor with IP address x.x.x.x, which is the neighbor representing connection A or B to the specific branch office. The

route-map matches the prefix-list branch-x

which contains the IP address range for branch office x. The

set local-preference

command increases the local preference value to 200 for these routes, which means that the ASR routers will prefer the path with the highest local preference value to reach that destination.

Default local-preference

is 100 ; path with the 

highest local preference

is prefered.

You will need to repeat this configuration for each neighbor representing each connection to the various branch offices. Keep in mind that other BGP attributes such as AS path length and origin type may also affect route selection, so you may need to adjust those attributes as well to achieve the desired traffic flow.

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

https://www.catchpoint.com/bgp-monitoring/bgp-attributes

 

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Let me see if I have this correct.

 

I would need to add this command to both my Cisco ASR 920 routers

 

router bgp XYZ

neighbor 50.50.50.1 route-map California-out out

!

route-map California-out permit 10

match ip address prefix-list California-out

set local-preference 200

 

So if I understand this right the 50.50.50.1 IP is the IP of that branch office that is not part of my local subnet/IPs im using for BGP?

 

Thank you

 

 

Sorry what issue here 

You have hub & spoke topolgy and you run bgp inbetween?

I have a hub and spoke VPN topology, but BGP is only running at the hub for redundancy on our internet. We have the same ISP for both internet circuits and run bgp between the two circuits. The branch offices have no routing protocol between them and us. 

Any routing protocol will use destiantion to forward traffic via specific path'

Here you want branchA to use ISP1 and branchB to use ISP2 

This done only by pbr' pbr check the source of packet and destination.

Correct, so to have branch a prefer isp 1 do I do this?

 

router bgp XYZ

neighbor 50.50.50.1 route-map California-out out

!

route-map California-out permit 10

match ip address 60.60.60.0 255.255.255.248 California-out

set local-preference 200

 

My question also is on the neighbor IP is that the IP address of my next hop for ISP1 or what exactly is it?

 

My setup is a /24 subnet that we own, then the ISP has provided us a /29 for each Internet connection that we use to route to them.

 

Thank you for your help

Currently here is what I have on both ASRs

router bgp 12345
bgp log-neighbor-changes
neighbor 4.4.1.1 remote-as 3356
neighbor 4.5.19.1 remote-as 3356
neighbor 150.150.150.254 remote-as 12345
!
address-family ipv4
network 150.150.150.0 mask 255.255.255.0
redistribute connected route-map TO_PEER
neighbor 4.4.1.1 activate
neighbor 4.4.1.1 route-map BGP_INBOUND in
neighbor 4.4.1.1 route-map BGP_OUTBOUND out
neighbor 4.5.19.1 activate
neighbor 4.5.19.1 route-map BGP_INBOUND in
neighbor 4.5.19.1 route-map BGP_OUTBOUND out
neighbor 150.150.150.254 activate
neighbor 160.150.150.254 next-hop-self
exit-address-family

this your topology, 
you want spoke1 to reach ISP1 and spoke2 reach ISP2 ?
am I right ?

Screenshot (580).png

Basically yes, I want spoke 1 to prefer ISP1 and spoke 2 to prefer ISP2

 

Thanks for all your input and help

Screenshot (583).pngScreenshot (584).png

 

 

R1 config (Hub)
interface Tunnel0
ip address 5.0.0.1 255.255.255.0
no ip redirects
no ip next-hop-self eigrp 5
ip nhrp map multicast dynamic
ip nhrp network-id 5
no ip split-horizon eigrp 5
ip policy route-map ISPs
tunnel source FastEthernet0/0
tunnel mode gre multipoint
tunnel key 5
!
!
interface FastEthernet0/0
ip address 100.0.0.1 255.255.255.0
duplex half
!
interface FastEthernet2/0
ip address 10.0.0.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet3/0
ip address 20.0.0.1 255.255.255.0
duplex auto
speed auto
!
router eigrp 5
network 5.0.0.0 0.0.0.255
redistribute bgp 100 metric 100 100 255 1 1500
!
router bgp 100
no synchronization
bgp log-neighbor-changes
redistribute eigrp 5
neighbor 10.0.0.4 remote-as 400
neighbor 10.0.0.4 route-map Spoke1 out
neighbor 20.0.0.6 remote-as 600
neighbor 20.0.0.6 route-map Spoke2 out
no auto-summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
ip route 0.0.0.0 0.0.0.0 100.0.0.5
!
!
ip prefix-list 2.2.2.2 seq 10 permit 2.2.2.2/32
!
ip prefix-list 3.3.3.3 seq 10 permit 3.3.3.3/32
access-list 100 permit ip host 2.2.2.2 any
access-list 110 permit ip host 3.3.3.3 any
no cdp log mismatch duplex
!
!
!
!
route-map ISPs permit 10
match ip address 100
set ip next-hop 10.0.0.4
!
route-map ISPs permit 20
match ip address 110
set ip next-hop 20.0.0.6
!
route-map Spoke2 permit 10
match ip address prefix-list 2.2.2.2
set as-path prepend 100 100
!
route-map Spoke1 permit 10
match ip address prefix-list 3.3.3.3
set as-path prepend 100 100

Joseph W. Doherty
Hall of Fame
Hall of Fame

"Is it possible to say have traffic destined for branch office x to prefer connection B over A?"

Typically, answer is yes.

Lots of ways to accomplish.

As you've provided very little detail about your current BGP usage, cannot really make any recommendations.

M02@rt37 has given an example of one common approach influencing routing going outbound but you can also influence routing to you, and, you can mix and match different approaches.  (Actually all the "control knobs" of BGP is one of its greatest [or, depending on your point of view, worse] features.)

BTW you could also select specific destinations to use one connection vs. another.

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: