1
I need to do redirect port 443 on all interfaces to 8080 on one interface using iptables
on a box with 2 NICs.
I also need to block pretty much anything else on those interfaces.
Here is my iptables files:
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp -d 10.10.1.9 --dport 443 -j DNAT --to 10.10.1.9:8080
-A PREROUTING -i eth1 -p tcp -d 10.10.1.10 --dport 443 -j DNAT --to 10.10.1.9:8080
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth1 -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -j DROP
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
What I'm doing wrong or in other words why this doesn't work?