All of lore.kernel.org
 help / color / mirror / Atom feed
* iptables redirects packets to local proxy
@ 2013-11-30 16:46 ilic_68
  2013-11-30 17:40 ` Phil Oester
  0 siblings, 1 reply; 4+ messages in thread
From: ilic_68 @ 2013-11-30 16:46 UTC (permalink / raw)
  To: netfilter

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

Hello,

consider this scenario:

PC1 wants to telnet to SRV1 tcp 40000.

I would like to put a proxy in the middle that receives the
connection, rewrites the destination, sends packet to a local socks proxy (redsocks).

So the scenario would be:

PC1 --> PROXY tcp 20000 [iptables rewrites destination to SRV tcp 40000 --> redsocks 127.0.0.1 tcp 12345] --> SRV1 tcp 40000

I tried:
iptables -t nat -A PREROUTING -p tcp -s $MYSOURCEIP --dport 20000 -j DNAT --to $SRV1:40000

It works, but I know it doesn't go through redsocks.
I just changed the destination for the packets but how can I force them to flow into redsocks?

Thank you for any help, Ilic


^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <529A42E6.7030504@gmail.com>]

end of thread, other threads:[~2013-11-30 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-30 16:46 iptables redirects packets to local proxy ilic_68
2013-11-30 17:40 ` Phil Oester
     [not found] <529A42E6.7030504@gmail.com>
2013-11-30 20:17 ` Phil Oester
2013-11-30 21:39   ` Antonio Prado

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.