Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Gustavo Narea <me@gustavonarea.net>
To: netfilter@vger.kernel.org
Subject: Re: Port redirection not working
Date: Thu, 24 Jan 2008 16:50:29 +0100	[thread overview]
Message-ID: <200801241650.38884.me@gustavonarea.net> (raw)
In-Reply-To: <1201188765.25760.40.camel@khasse.inl.fr>

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

Eric, thank you very much for your help! It's now working!

Cheers.

On Thursday 24 January 2008 16:32:45 Eric Leblond wrote:
> 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!



-- 
Gustavo Narea.
http://gustavonarea.net/

Get GNU/Linux! http://www.getgnulinux.org/

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2008-01-24 15:50 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
2008-01-24 15:50       ` Gustavo Narea [this message]

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=200801241650.38884.me@gustavonarea.net \
    --to=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