On Sunday 26 February 2012, James Knott wrote:
Per Jessen wrote:
Yep, I have a number of servers in just such a setup - each server has two possible outbound paths, but the kernel cannot know which one is actually available, so I control that manually (scripted). (three options: left is up, right is up, both are up).
When both are up, how do you select? Are both on the same ISP? If not, you have to use some method to determine which becomes the default route.
There is no such thing as the_one_and_only default route. Each routing table may (or may not) have it's own default route.
The only trick is how to get an IP packet routed via the right routing table, see ip rule
It is possible in Linux to have two or more ISPs and then a TCP connection uses one or the other for the duration of the connection. But again, there has to be some mechanism to chose a default route.