Two default gateways.
I have two network cards, eth0, and eth1. Each interface has an IP address with the option of having a default gateway, but at present only eth0's gateway is set up as the default route.
I have applications that can launch using -iface ethX. They work fine when using eth0, but not eth1, unless I remove my default route for eth0 and add eth1 as the default route or add a static route to that interface.
My question is this: How can I make it so that I can have two default routes, with eth1's default route only being used when packets flow in or out of eth1?
Is this possible?
Thanks in advance!
There is -by definition- only one default gateway.
I have no idea about your setup and network layout, but in the simplest case you could try to enable IP forwarding.
I have once seen a network with 2 gateways that shared the loads, but I don't know if that's what you're talking about.
Either way, I don't know yet how to set these things up. I don't think it was an easy project, as the developers told me, but they weren't linux users anyway.
I would be more than happy to try and find the developers, and ask them, if necessary.
You can do with linux advanced routing
google lartc . You will see the howto. This is your solution.I made myself so many kind of multi gateway router with linux advanced routing.You can do.
you can do by Iproute on etho of gateway & ip