From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wilson Mak Subject: Port Forwarding with iptables Date: Thu, 19 Aug 2004 18:57:59 +0800 Sender: netfilter-admin@lists.netfilter.org Message-ID: <412487B7.9090505@digitalview.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: netfilter@lists.netfilter.org Hi all, I like to do the portforwarding with iptables(forward web traffic of an alias IP - to internal web server). Here is what I have: iptables -t nat -A PREROUTING -i eth0 -d -p tcp --dport 80 -j DNAT --to 10.1.0.12:80 iptables -A INPUT -p tcp -i eth0 -d --dport 80 -m state --state NEW -j ACCEPT iptables -A FORWARD -p tcp -i eth0 -o eth1 -d --dport 80 -m state --state NEW -j ACCEPT However, it keep droping the packets when getting to the NAT box. Logs ==== (With iptables -A FORWARD -d 10.1.0.12 -j LOG; iptable -A FORWARD -j DROP) kernel: IN=eth0 OUT=eth1 SRC=202.xxx.122.xxx DST=10.1.0.12 LEN=48 TOS=0x00 PREC=0x00 TTL=120 ID=6491 DF PROTO=TCP SPT=4023 DPT=80 WINDOW=64240 RES=0x00 SYN URGP=0 Any clues? Did I miss something here? Thanks, Wilson