forwarding/routing traffic (+nat) to gw in a custom routing table
"Marc Roos" <[email protected]> Fri, 08 Nov 2019 15:48:25 +0000
| Newsgroups | org.kernel.vger.lartc |
|---|---|
| Message-ID | <"H00000710015496d.1573228105.sx.f1-outsourcing.eu*"@MHS> |
I have two interfaces: eth0 192.168.122.2 eth1 1.1.1.10 I have a routing table 4, with: default via 1.1.1.1 dev eth1 I have rules: 32764: from all to 1.1.1.10 lookup 4 32765: from 1.1.1.10 lookup 4 If I ping from a natted host to 8.8.8.8, I am getting From 192.168.122.2 icmp_seq=1 Destination Net Unreachable If I know add this rule ip rule add from 192.168.122.0/24 to 8.8.8.8 lookup 4 The ping starts working. However I need to have this working for 0.0.0.0/0 except 192.168.122.0/24. How should I implement something like: ip rule add from 192.168.122.0/24 to !192.168.122.0/4 lookup 4