BGP Multi-homed Through One Router
by admin on Nov.26, 2007, under Networking, Routers
So if you are multi-homed on BGP and you want to be able to decide yourself which path incoming and outgoing your traffic will take you will need to make a few changes. By default BGP will try to make the best decision on what path to take. Problem is a lot of time it will just choose the lowest AS number which might not be the best route.
router bgp 11111
neighbor 2.2.2.2 weight 500
neighbor 3.3.3.3 weight 400
neighbor 3.3.3.3 route-map prepend out
ip prefix-list aggregate seq 5 permit 1.1.1.0/24
route-map prepend permit 10
match ip address prefix-list aggregate
set as-path prepend 11111 11111 11111 11111 11111
Under your BGP config on your router add some weight statements, the higher the weight the more preferred route for outgoing traffic. The route-map prepend out statement you will want to put on the neighbor that you don’t want traffic coming in on. Incoming BGP traffic will always try to take the smallest AS number first so if you prepend your AS number onto your neighbors AS path it will seem like the worst path. This will give you the effect of incoming traffic on the neighbor without the prepend router-map.