From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Scherf Subject: Re: port redirect for localy generated request Date: Sat, 30 Aug 2003 10:04:01 +0200 Sender: netfilter-admin@lists.netfilter.org Message-ID: <200308301004.02160.tscherf@web.de> References: <000801c36e35$3f7cee60$8c01a8c0@RSUNDARAM> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <000801c36e35$3f7cee60$8c01a8c0@RSUNDARAM> Content-Disposition: inline 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: Sundaram Ramasamy , netfilter@lists.netfilter.org > With this rule incoming request for port 80 redirected to port 8080. But > this is not working localy generated request. > iptables -t nat -A PREROUTING -p tcp --dport 80 -d LISTEN_IP -j DNAT --to > LISTEN_IP:80 You have to use the OUTPUT Chain for localy generated packets: iptables -t nat -A OUTPUT -p tcp --dport -d $LISTEN_IP -j DNAT --to $LISTEN_IP:8080 Greetings, Thorsten Scherf RHCE, RHCX