I have a multi-homed network setup. I'm using a Cisco 7200 to do BGP advertising to both provider A and B. For each provider, I have a separate /24 that I'm using. I am AS prepending to influence the block A to provider A, and block B to provider B. This works fine. If either provider goes down, failover works great.
However, I also want to influence OUTBOUND traffic to flow to each provider in the same way. That is, as traffic comes in my router, I want to associate its outflow to the provider based on the source IP address. As is, each provider advertises to me just a default route.
I believe I can use routing policy to achieve this, but I don't want to hardcode the IP addresses in the policy since they could change dynamically.
So, what are my options to influence the outbound routing?
Best Answer
From what I understand you want trafic that come from ProviderA to go back to ProviderA and trafic that come from ProviderB to go back to ProviderB.
I don't really understand "I don't want to hardcode the IP addresses", as a /24 will not be dynamic. So I would do a route-map based on the source address. It's not 100% good because you may have received trafic on ProviderA IPs from the ProviderB link even with AS prepending and you will send back the trafic to ProviderA instead of ProviderB but it will be Ok most of the time.
Then apply
policy route-map SOURCE_ROUTING
on the interface that receive data that need to go out.