I have issue achieving this: A-->B-->C-->internet (doing A--C-->internet is working)
- A: client lan: 192.168.57.0/24 (example 192.168.57.50)
- B: ubuntu GW eth0: 172.10.0.1 (/24, default gw:172.10.0.254) eth1: 192.168.57.1 (/24) eth3 10.152.152.0 (/18)
- C: whonix-gw eth0: 10.0.0.1 eth1: 10.152.152.10
At the beginning I tried using ipbales and tried DNAT
, MASQUERADE
, etc. but was not able to achieve the goal.
Then I tried with PBR (policy based routing), so created a new table and added the default gw and the policy with no luck.
echo 200 John >> /etc/iproute2/rt_tables
ip rule add from 192.168.57.1 table John #tried also adding the subnet here
ip route add default via 10.152.152.10 dev eth3 table John
ip route flush cache