I have a static 1:1 NAT setup in iptables which excludes a the larger subnet (so that NETMAP hosts can still get to other local hosts which are not static NAT) like so:
*nat
-A PREROUTING --destination 128.128.196.32/27 -j NETMAP --to 10.10.20.32/27
-A POSTROUTING --source 10.10.20.32/27 ! -d 10.0.0.0/8 -j NETMAP --to 128.128.196.32/27
I would also like to exclude public facing IP addresses so that static NAT hosts can still reach the public IP address of another static NAT host on the machine. But multiple negated destinations do not seem to be supported. This throws an error:
*nat
-A PREROUTING --destination 128.128.196.32/27 -j NETMAP --to 10.10.20.32/27
-A POSTROUTING --source 10.10.20.32/27 ! -d 10.0.0.0/8 ! -d 128.128.196.0/24 -j NETMAP --to 128.128.196.32/27
How can I setup iptables to allow static NAT NETMAPed hosts to reach other public addresses on the iptables machine?