03-13-2012 10:00 AM - edited 03-04-2019 03:38 PM
Hello,
I have two locations with two BGP routers facing the same ISP BGP router via different links.
I have advertised network x.x.x.x/24 from location 1 and network y.y.y.y/24 from location 2 via the same BGP AS.
I have a local link between the locations connecting BGP routers with EIGRP redistributing default route
Now I need to advertise both networks from both locations, but I need higher priority for the "home" network over the "foreign" network, so traffic from ISP would prefer first location for it's "home" network in case if both paths are available.
Location 1 (home network x.x.x.x/24)
BGP AS 10
Advertised network x.x.x.x/24
Need to advertise "foreign" network y.y.y.y/24 with lower priority to kick in only if there is no path to Location 2
Location 2 (home network y.y.y.y/24)
BGP AS 10
Advertised network y.y.y.y/24
Need to advertise "foreign" network x.x.x.x/24 with lower priority to kick in only if there is no path to Location 1
Since I am new to BGP I guess this could be achieved somehow with BGP prepend, I would appreciate if you can give me a sample based on my topology.
Thanks!
Solved! Go to Solution.
03-13-2012 10:12 AM
You are in the right path,
AS-PATH prepend will provide the solution you are after.
On Location 1, you will advertise both x.x.x.x/24 and y.y.y.y/24 while prepending y.y.y.y/24
On Location 2, you will do the opposite.
Location 1:
access-list 1 permit y.y.y.y/24
route-map prepend
match ip address 1
set as-path prepend 10 10 10
router bgp 10
neighbor x.x.x.x route-map prepend out
Location 2:
access-list 1 permit x.x.x.x/24
route-map prepend
match ip address 1
set as-path prepend 10 10 10
router bgp 10
neighbor x.x.x.x route-map prepend out
03-14-2012 06:31 AM
Yes, you need a network statements in both locations and those networks must be in the routing table in order to be advertised by BGP.
03-13-2012 10:12 AM
You are in the right path,
AS-PATH prepend will provide the solution you are after.
On Location 1, you will advertise both x.x.x.x/24 and y.y.y.y/24 while prepending y.y.y.y/24
On Location 2, you will do the opposite.
Location 1:
access-list 1 permit y.y.y.y/24
route-map prepend
match ip address 1
set as-path prepend 10 10 10
router bgp 10
neighbor x.x.x.x route-map prepend out
Location 2:
access-list 1 permit x.x.x.x/24
route-map prepend
match ip address 1
set as-path prepend 10 10 10
router bgp 10
neighbor x.x.x.x route-map prepend out
03-13-2012 10:30 AM
Thank you Edison for quick reply.
Should I keep "network" statements under the "router BGP 10" definitions?
Namely, if we take Location 1 (x.x.x.x/24 - "home" and y.y.y.y/24- "foreign" and z.z.z.z - ISP router )
Location 1:
access-list 1 permit y.y.y.y/24
route-map prepend
match ip address 1
set as-path prepend 10 10 10
router bgp 10
network y.y.y.y mask 255.255.255.0
network x.x.x.x mask 255.255.255.0
neighbor z.z.z.z route-map prepend out
03-14-2012 06:31 AM
Yes, you need a network statements in both locations and those networks must be in the routing table in order to be advertised by BGP.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide