From mboxrd@z Thu Jan 1 00:00:00 1970 From: Georgi Alexandrov Subject: Re: Port DNATting Date: Sat, 26 Nov 2005 12:20:09 +0200 Message-ID: <438836D9.5050204@gmail.com> References: <814141710.20051126124425@progtech.ru> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <814141710.20051126124425@progtech.ru> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-bounces@lists.netfilter.org Errors-To: netfilter-bounces@lists.netfilter.org Content-Type: text/plain; charset="us-ascii"; format="flowed" To: netfilter@lists.netfilter.org Oleg A. Arkhangelsky wrote: >Hello All, > > When I'm trying to do something like this: > > iptables -t nat -I POSTROUTING -p tcp --dport 8080 -j DNAT --to :80 > > I get: "iptables: Invalid argument". > > What I want is only to translate destination port of all TCP-packets > going to some_ip:8080 into some_ip:80. I don't want to change IP. It > seems that syntax of this command is corrent, but... What is wrong? > > Thanks! > > P.S.: Kernel 2.4.31, iptables v1.3.2 > > > If you want to do that you should read the iptables-tutorial.frozentux.net, then use the REDIRECT target: iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to 80 regards, Georgi Alexandrov