Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Jorge Bastos <mysql.jorge@decimal.pt>
To: Leonardo Rodrigues <leolistas@solutti.com.br>
Cc: ML netfilter <netfilter@vger.kernel.org>
Subject: Re: Help on outgoing packet (without NAT)
Date: Thu, 22 Sep 2011 17:44:50 +0100	[thread overview]
Message-ID: <da2100d26099890bb06e4b87ab5cac93@decimal.pt> (raw)
In-Reply-To: <4E7B64CE.8060107@solutti.com.br>

Hi,

> Your rule is absolutely incomplete and nonsense
>
> packet redirections should be done on the NAT table. If no table is
> specified on the command, you'll work on the filter table, which is 
> not
> the one you want here. So '-t nat' is needed.
>
> the '--redirect-to' is not an argument for any of the known targets
> i know .... but as it seems you want to redirect some packet to 
> another
> machine, than you'll probably want the DNAT target. Anyway, you have 
> not
> specified any target, so iptables simply doesnt know what to do.
>
> calling the correct target with correct argument, your rule should
> look something like:
>
> iptables -t nat -I OUTPUT -d 5.5.5.5 -p tcp --dport 80 -j DNAT
> --to-destination 192.168.1.221
>
> no need to specify the :80 port to the destination target. If you
> want to redirect to the same port, you dont need to specify that. You
> would need to specify if you were changing ports.

Well I was convinced that, since I'm not using NAT on this machine, 
this couldn't be done on the NAT table.
Thanks, after all, it works.

Jorge,

  reply	other threads:[~2011-09-22 16:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 15:29 ping broadcast into forward chain?? (IN=eth0 OUT=eth0)!! Julio A. Romero
2011-09-19 15:38 ` Jan Engelhardt
     [not found]   ` <9C0FCAA46B9040869B79B468CCA7391C@poweredge1800>
2011-09-19 15:55     ` Jan Engelhardt
2011-09-19 16:10       ` Julio A. Romero
2011-09-19 16:15         ` Jan Engelhardt
2011-09-19 16:38           ` Julio A. Romero
2011-09-19 17:07             ` Jan Engelhardt
2011-09-20  0:22           ` Julio A. Romero
2011-09-21 21:23       ` Help on outgoing packet (without NAT) Jorge Bastos
2011-09-21 21:47         ` Andrew Beverley
2011-09-22 15:58           ` Jorge Bastos
2011-09-22 16:29             ` Jan Engelhardt
2011-09-22 16:31               ` Jorge Bastos
2011-09-22 16:39             ` Leonardo Rodrigues
2011-09-22 16:44               ` Jorge Bastos [this message]
2011-09-22 16:46                 ` Jan Engelhardt
2011-09-22 17:02                 ` Leonardo Rodrigues
2011-09-21 22:42         ` Jan Engelhardt

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=da2100d26099890bb06e4b87ab5cac93@decimal.pt \
    --to=mysql.jorge@decimal.pt \
    --cc=leolistas@solutti.com.br \
    --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