09-01-2017 07:35 AM - edited 03-05-2019 09:04 AM
Hi All,
I've come across a minor issue on our network which is something that hadn't crossed my mind when configuring our multihomed BGP environment.
I am learning a destination from our least preferred peer, within a /24 subnet. I am learning the same destination from our preferred peer within a /23 subnet.
Therefore regardless of my local-preference configuration, because the more specific route is being learnt, traffic is going out via our least preferred transit peer.
What is the most efficient way to control this, so our preferred transit, stays preferred?
Thanks
Colin
09-01-2017 07:45 AM - edited 09-01-2017 07:46 AM
Hi
I think you shoud filter the traffic with prefix-lists from both peers and associated that with your local preference values.
Example:
ip prefix-list BGP seq 5 permit x.x.x.x/23
route-map ISP1 permit 5
match ip address prefix BGP
set local-preference 1000
route-map ISP2 permit 5
match ip address prefix BGP
set local-preference 500
router bgp 100
neighbor 1.1.1.1 route-map ISP1 in
neighbor 2.2.2.2 route-map ISP2 in
Hope it is useful
:-)
09-01-2017 08:12 AM
09-01-2017 09:01 AM
Do you recieve a /23 too from your lease preferred ISP?
You can filter receving /24 or more specific prefixes from it:
ip pref BLOCK-SPECIFIC deny 0.0.0.0/0 ge 24
ip pref BLOCK-SPECIFIC permit 0.0.0.0/0 ge le
router bgp 123
neighbor x.x.x prefix-list BLOCK-SPECIFIC in
this way you will have 2 /23 paths, and you can apply local pref or other traffic engineering technique to direct your traffic as you want.
Please test this in a LAB to make sure you will get the results you are expecting.
09-02-2017 03:30 AM - edited 09-02-2017 07:17 AM
Duplicate post -
09-02-2017 03:57 AM - edited 09-02-2017 03:59 AM
Hello
Just to add to julios post, you could try using prefix-list to accomodate local preferance.
ip prefix-list STAN permit 0.0.0.0/23
ip prefix-list STAN2 permit 0.0.0.0/24
route-map Preferred-ISP permit 10
match ip address prefix-list STAN
set local-preference 20000
route-map Preferred-ISP permit 99
route-map least-Preferred-ISP permit 10
match ip address STAN2
set local-preference 10000
route-map least-Preferred-ISP permit 99
router bgp xx
neighbor x.x.x.x route-map Preferred-ISP in
neighbor x.x.x.x route-map least-Preferred-ISP in
If that isnt applicable then you could try using a EEM script with an AS-Path filter to match on the say a AS these prefixs originate from or transit through or even both.
ip as-path access-list 5 deny _1111_
ip as-path access-list 5 permit .*
ip sla 10
icmp-echo x.x.x.x source-IP x.x.x.x
ip sla schedule 10 life forever start-time now
track 1 rtr 10 reachability
event manager applet ISP1-UP
event track 1 state up
action 5.0 cli command "enable"
action 5.1 cli command "conf t"
action 5.2 cli command "router bgp xx"
action 5.3 cli command "neighbour filter-list 5 in"
action 5.4 cli command "end"
event manager applet ISP1-DOWN
event track 1 state down
action 5.5 cli command "enable"
action 5.6 cli command "router bgp xx"
action 5.7 cli command "no neighbour filter-list 5 in"
action 5.8 cli command "end"
res
Paul
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