I have an existing iptables setup that does port forwarding. In this port forwarding scenario there are some instances where I do not want it to port forward. So, for instance I have this defined:
iptables -A PREROUTING -t nat -i eth0 '!' -s 10.200.0.0/16 -p tcp --dport 80 -j DNAT --to 10.200.30.11
This will prevent 10.200/16 from accessing this rule. As it turns out, I need to add multiple exclusions. However, there does not seem to be a way to do this:
iptables -A PREROUTING -t nat -i eth0 '!' -s 10.200.0.0/16,192.168.0.0/16 -p tcp --dport 8080 -j DNAT --to 10.200.30.11:80 iptables v1.4.8: ! not allowed with multiple source or destination IP addresses
I'm going to assume I have to approach this differently, but I do not know how. Any suggestions?