I have added a second ethernet to a host in order to route backups traffic over a second wire (to avoid saturating the main link). I have to rely on network admins on the other side of planet for this, and they gave me a second IP in the same subnet as the main interface.
I attempted to add a route like this to force traffic via the backups link (e1000g1
) rather than the main link (e1000g0
):
route add 10.0.1.19 192.168.2.1 -ifp e1000g1
where:
10.0.1.19
is my backup server192.168.2.1
is the gateway for the local subnet
This did not work. If I try to ping the backup server from the host, snooping on both interfaces shows that packets never even go out. I just get ICMP unreachable.
On the suggestion of a coworker, I also tried this variation:
route add 10.0.1.19 192.168.2.5 -ifp e1000g1
Where 192.168.2.5
is the interface address for e1000g1
. That has the same result.
Is it possible to make this work, or do I need to have two separate subnets for this to work?
You should be able to this, you just need to add a higher metric for the secondary route.
By default the primary route will have metric 1 so in order to add the second one you just need any higher value.
route add 10.0.1.19 192.168.2.5 -ifp e1000g1 metric 2
This way when the first route goes down the traffic will automatically go through the secondary network
I don't know it is even possible to set up a routing entry like this. My company uses dedicated backup interfaces too, but they're on a different physical network and subnet, so no routing problems there. I suggest three possible solutions:
1st, get an IP on a different subnet. 2nd, set up load balancing over both interfaces, the backup impact on the other interface gets smaller, and while not backing up, production gets more overall speed. 3rd, limit the amount of bandwidth your backup application is allowed to use.