0

I'm using a Raspberry Pi with Raspbian GNU/Linux 9.6 (stretch) as a firewall.

I would like to:

  1. route all traffic to 192.168.1.1 through eth0 (192.168.1.144), where 192.168.1.1 is the router that connects to the internet
  2. route all traffic to the rest of the home network 192.168.1.0/24 through eth1 (192.168.1.196)
  3. route all traffic coming from the various access points (dd-wrt routers, 192.168.1.2, 192.168.1.36 and 192.168.1.72 respectively) to 192.168.1.196
  4. and from there to 192.168.1.144 and out to the internet via 192.168.1.1

How should I set this up?

These two questions seem to give conflicting answers, at least to networking-rookie-me:

Thanks

  • Does your RaspPi do NAT (network access translation)? Do you have any actual firewall rules (iptables or packages using iptables)? If no to both questions, it's a pure routing problem, and you can solve it with policy routing (google) for the "route traffic from ..." cases. A bunch of routing rules should suffice. – dirkt Jan 23 at 6:14

Your Answer

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

Browse other questions tagged or ask your own question.