- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 06:39 AM
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
Solved! Go to Solution.
- Labels:
-
Routing Protocols
-
WAN
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023
06:42 AM
- last edited on
03-28-2023
10:07 PM
by
Translator
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
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023
06:42 AM
- last edited on
03-28-2023
10:07 PM
by
Translator
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
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 08:43 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 08:53 AM
Sorry what issue here
You have hub & spoke topolgy and you run bgp inbetween?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 08:55 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 09:06 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 09:11 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 09:22 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 10:28 AM
this your topology,
you want spoke1 to reach ISP1 and spoke2 reach ISP2 ?
am I right ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 10:43 AM
Basically yes, I want spoke 1 to prefer ISP1 and spoke 2 to prefer ISP2
Thanks for all your input and help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 08:45 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 07:08 AM
"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.
