From: Michael Stilmant <ml-netfilter@adtech.be>
To: netfilter@lists.netfilter.org
Subject: RE: transparent tcp proxy
Date: 27 May 2003 09:46:58 +0200 [thread overview]
Message-ID: <1054021618.18150.49.camel@stilmant> (raw)
In-Reply-To: <1054016670.1847.213.camel@alpha.newkirk.us>
On Tue, 2003-05-27 at 08:24, Joel Newkirk wrote:
> You'd need to handle this outside of iptables/ebtables, but it could be
> done.
Thanks to answer. but I don't understand well how to do this, but I'll
check your idea.
And this is in fact this is how I really do the stuff.
10.0.0.225
+--------+
| B |
+-----+ | | +-----+
| A +-----------[ebtables]----------| C |
+-----+ +--------+ +-----+
10.0.0.3 10.0.0.32
I've made a C program able to update the kernel iptables. This program
read a config file where they are the remote port and the remote IP
address to listen for (address of A; A is the server for B machine to
connect on port 3435)
So when the program start, it update iptables like if you have done this
rule :
iptables -t nat -A PREROUTING -i eth1 -d 10.0.0.3 -p tcp --dport 3435 -j
DNAT --to-destination 10.0.0.225:3625
And after that the program start a tcp server on B machine to listen
routed traffic from B.
When a connection came from C to the special port on A, traffic is
routed locally to the listening TCP server. this server known now the
source IP and update iptables with this rules.
iptables -t nat -A POSTROUTING -o eth0 -d 10.0.0.3 -p tcp --dport 3435
-j SNAT --to-source 10.0.0.32
since the ip source is well known now.
after that the program open a tcp connection to A:3435.
Now I can use the B tcp server to listen and interact with the traffic
between A and C.
Now I've a connection from C to B where I can find the value of the
source IP address. I need to find a way to know also the MAC address,
perhaps with an IOCTL on the socket. and using this MIAC address to
update something somewhere to tell to the network layer wich MAC address
to use but only with the connection from B to A. and this will be great
if I can say this only for one TCP connection from B to A. Because I
want to try to be possible to put many C like machine on the right.
Best regards
Michael
next prev parent reply other threads:[~2003-05-27 7:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-24 2:05 transparent tcp proxy George Vieira
2003-05-26 8:45 ` Michael Stilmant
2003-05-27 6:24 ` Joel Newkirk
2003-05-27 7:46 ` Michael Stilmant [this message]
2003-05-27 8:34 ` Cedric Blancher
2003-05-27 9:49 ` Michael Stilmant
2003-05-27 10:49 ` Cedric Blancher
2003-05-27 11:48 ` Michael Stilmant
2003-05-27 13:23 ` Cedric Blancher
2003-05-27 13:32 ` About Mexico Leandro
-- strict thread matches above, loose matches on Subject: below --
2003-05-23 15:06 transparent tcp proxy Michael Stilmant
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=1054021618.18150.49.camel@stilmant \
--to=ml-netfilter@adtech.be \
--cc=netfilter@lists.netfilter.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.