[TriLUG] Routing traffic to a non-default gateway

Mauricio Tavares via TriLUG trilug at trilug.org
Wed Jan 11 09:06:39 EST 2023


I have a linux host, bob, acting as a router. Traffic goes out using
its default gateway, 192.168.1.1/24 interface br-out. So far so good.

I have two networks I would like to focus on:
- 192.168.10.0/24, interface br-closed. bob is also acting as dhcp/dns
for this network.
- 192.168.2.0/30 (hop to other router, whose IP is 192.168.2.2),
interface br-hop

I want to have all devices in br-closed to use br-hop as their default
gateway, and I seem to be having a hard time writing the proper ip
route statement for that. Or maybe I should use iptables instead,
which leads to: what is the best way and why?


More information about the TriLUG mailing list