I came across a requirement to achieve some routing preference using BGP with the service provider on the Internet.
We are having 2 Internet links from different service providers, Provider-A and Provider-B and both running BGP with us. The BGP is configured to send full routing updates. For a particular network say 18.104.22.168 /24 we want to prefer Provider-A as the preferred provider for incoming and outgoing traffic.
How best can this be achieved? For incoming traffic we can simply prepend the network 22.214.171.124 /24 with higher AS path out of Provider-B. Is it a general practice that Provider-B strip the prepends?
How can we work on the outgoing traffic? Route-maps?
Is it a general practice that Provider-B strip the prepends?
no the provides don't strip the prepends. For incoming traffic to you as-path prepend should work fine.
As for outgoing traffic, you can use higher local pref for your local subnet to take let say provider-A
Thanks for the input Reza, I am still wondering how will Local Pref help me influence outgoing traffic.
In this case traffic originatin from the local subnet i.e. 126.96.36.199 /24(as an example) destined to any network across the globe should also take Provider-A.
normally outgoing traffic in BGP is manipulated by local-pref. But this is based on target IP addresses, not on source addresses.
Manipulation on source addresses could only be done by policy based routing.