From: "R. Sterenborg" Subject: RE: DNAT Help Date: Mon, 21 Oct 2002 08:46:47 +0200 Sender: netfilter-admin@lists.netfilter.org Message-ID: <000201c278cd$a159c940$0401000a@robbysan.org> References: <004f01c27890$69ce59b0$8b1c000a@raven> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <004f01c27890$69ce59b0$8b1c000a@raven> 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" To: netfilter@lists.netfilter.org > I'm trying to telnet to 1.2.3.4 port 25 > > Where I'm DNATing 1.2.3.4 to 1.2.3.5 > > telnet is still trying to connect to 1.2.3.4 but it never get any connections. > > Here is my nat table. > > > mailserv:/etc# /sbin/iptables -L -t nat > Chain PREROUTING (policy ACCEPT) > target prot opt source destination > DNAT all -- anywhere 1.2.3.4 to:1.2.3.5 > > Chain POSTROUTING (policy ACCEPT) > target prot opt source destination > > Chain OUTPUT (policy ACCEPT) > target prot opt source destination > DNAT all -- anywhere 1.2.3.4 to:1.2.3.5 You should not use the OUTPUT chain in the nat table ; just the PREROUTING chain will do. Do you also have a FORWARD rule in the filter table ? I think you need something like : iptables -A FORWARD -i -d 1.2.3.5 -p tcp --dport 25 -j ACCEPT Is your prerouting rule something like : iptables -t nat -A PREROUTING -d 1.2.3.4 -p tcp --dport 25 -j DNAT --to-destination 1.2.3.5:25 Do you have : echo 1 > /proc/sys/net/ipv4/ip_forward Rob