I have a gateway box with two internet connections, eth0 and eth1, and a LAN connection eth2.

Currently eth1 is unused and eth2 LAN traffic is forwarded/masqueraded and sent to the internet via eth0.

What is the most straightforward way to send the eth2 LAN traffic to the internet via eth1? I want local traffic to still go via eth0.

(I am aware that I can tag packets in iptables, then route on the tag, but I was wondering whether I had missed a simpler solution.)


set the gateway for the local network to the interface eth1 and for localhost to eth0 in the routing table in your box.

  • Could you give an example? I thought a box could only have one default gateway, unless you use multiple routing tables and packet marking. – fadedbee Sep 24 '18 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.