From: Eric Leblond <eric@inl.fr>
To: Gustavo Narea <me@gustavonarea.net>
Cc: netfilter@vger.kernel.org
Subject: Re: Port redirection not working
Date: Thu, 24 Jan 2008 16:32:45 +0100 [thread overview]
Message-ID: <1201188765.25760.40.camel@khasse.inl.fr> (raw)
In-Reply-To: <200801241604.41073.me@gustavonarea.net>
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
Hi,
Le jeudi 24 janvier 2008 à 16:04 +0100, Gustavo Narea a écrit :
> Hello, Eric.
>
> On Thursday 24 January 2008 14:49:54 Eric Leblond wrote:
> > > I'm using this line in the attached file:
> > > -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
> >
> > Miss "-t nat" in the line, you need to specify the table to use.
>
> I've changed that line as you suggested, but now I get this error when running
> `iptables-restore < /etc/iptables.config':
Hmm sorry, I miss the iptables-restore way to add the rules.
iptables-restore format is not done to be hand edited (although this is
possible).
In fact, best thing to do is to :
* restore a working file
* add the NAT rules : iptables -t nat A PREROUTING -p tcp -m tcp
--dport 80 -j REDIRECT --to-ports 8080
* iptables-save>/etc/iptables.config
Your error was to add the REDIRECT rules in the filter table.
>
> ==========
> iptables-restore v1.3.6: Line 7 seems to have a -t table option.
>
> Error occurred at line: 7
> Try `iptables-restore -h' or 'iptables-restore --help' for more information.
> ==========
>
> It now reads:
> -A PREROUTING -t nat -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
>
> Thanks!
[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-01-24 15:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 11:43 Port redirection not working Gustavo Narea
2008-01-24 13:49 ` Eric Leblond
2008-01-24 15:04 ` Gustavo Narea
2008-01-24 15:32 ` Eric Leblond [this message]
2008-01-24 15:50 ` Gustavo Narea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1201188765.25760.40.camel@khasse.inl.fr \
--to=eric@inl.fr \
--cc=me@gustavonarea.net \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox