All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leonardo Rodrigues <leolistas@solutti.com.br>
To: ML netfilter <netfilter@vger.kernel.org>
Subject: Re: Help on outgoing packet (without NAT)
Date: Thu, 22 Sep 2011 13:39:42 -0300	[thread overview]
Message-ID: <4E7B64CE.8060107@solutti.com.br> (raw)
In-Reply-To: <675a49fcb8ddc3c241fab160c59946d8@decimal.pt>

Em 22/09/11 12:58, Jorge Bastos escreveu:
>
> Correct, local generated packets.
> Tried:
>
> iptables -I OUTPUT -d 5.5.5.5 -p tcp --dport 80 --redirect-to 
> 192.168.1.221:80
>
> I'm missing something but not sure what, but it's on the redirect part.

     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.

-- 


	Atenciosamente / Sincerily,
	Leonardo Rodrigues
	Solutti Tecnologia
	http://www.solutti.com.br

	Minha armadilha de SPAM, NÃO mandem email
	gertrudes@solutti.com.br
	My SPAMTRAP, do not email it





  parent reply	other threads:[~2011-09-22 16:39 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 [this message]
2011-09-22 16:44               ` Jorge Bastos
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=4E7B64CE.8060107@solutti.com.br \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.