I Think I just need a sanity check on some iptables rules. (spoiler alert its not good.)
The basic issue. We have a Squid Proxy server that is interfering with Various internet resources. I am remote and want to update the IPTable rules on the proxy server so that traffic never actually reaches the Proxy service. This is a temporary fix while I work on migrating the network to actual network hardware.
So the goal is to route all traffic that is not SSH from the Local network(enp5s0 10.90.30.1/16) to The "Router" (192.168.165.1/24) with the interface (enp4s0 192.168.165.1/24)
iptables -t nat -A PREROUTING -p tcp --dport 22 -d 10.90.30.1 -j INPUT
iptables -t nat -A PREROUTING -p tcp --dport 80 -d 10.90.30.1 -j INPUT
iptables -t nat -A PREROUTING -i enp5s0 -d 10.90.30.1 -j DNAT --to 192.168.165.1
iptables -t nat -A PREROUTING -i enp4s0 -d 192.168.165.151 -j DNAT --to 10.90.30.1
iptables -A INPUT -tcp --dport 22 -d 10.90.30.1 -j ACCEPT
iptables -A Foward -i enp5s0 -d 10.90.30.1 --dport 22 accept
iptables -t nat -A POSTROUTING -o enp4s0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o enp5s0 -j MASQUERADE
I appreciate all the help I can get. I like to think I understand Iptables enough to setup basic firewalls. But advanced routing is something I have never had to do.
How much NAT is too much NAT?
this much NAT.