I have a Linux box with two interfaces.
eth0 has ip 192.168.71.82/255.255.252.0
eth1 has ip 192.168.4.2/255.255.255.0
I need all traffic for subnets 192.168.4.0/24 192.168.3.0/24 192.168.2.0/24 to go through eth1 and all the rest to go through eth0.
Which is the best way to do this?
Cheers for the help.
Just set routes to your desired Networks over eth1:
And then set your default gateway to whatever you need:
(Nevertheless a route using an interface looks a bit strange to me - usually you should address the gateways using the correct router(s):
That ought to do it.