From: Martijn Lievaart <m@rtij.nl>
To: Adam <adam@sccode.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Layer (5,6,7) based NAT
Date: Sun, 29 Apr 2007 18:50:17 +0200 [thread overview]
Message-ID: <4634CCC9.2000201@rtij.nl> (raw)
In-Reply-To: <44301.80.177.104.4.1177854143.squirrel@webmail.modwest.com>
Adam wrote:
> I am wondering weather this is possible. I have one port and one public IP
> address lets say:
>
> 34.123.22.33:5615
>
> If I connect using SSH I want to DNAT to port 22, if I connect using SSL I
> want to DNAT to port 443, if I connect using HTTP I want to DNAT to port
> 80.
>
> If this kind of upper layer protocol determination possible? If so, is
> netfiter the application to do it?
>
No, this is not (easily) possible, and certainly not with iptables. The
reason is that you need a complete three way handshake before data
starts flowing and you can determine what protocol is spoken. However,
NAT must act at all packets, from the first. Besides, if you could start
NATting at a certain point, the recipient would not see the three way
handshake, so you cannot connect to your final destination.
Your only hope is some kind of proxy. And if you find it, please let me
know, I would be very interested as well.
HTH,
M4
next prev parent reply other threads:[~2007-04-29 16:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-29 13:42 Layer (5,6,7) based NAT Adam
2007-04-29 16:33 ` Kirk Wallace
2007-04-29 16:50 ` Martijn Lievaart [this message]
2007-04-29 17:19 ` Jan Engelhardt
2007-04-29 17:20 ` 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=4634CCC9.2000201@rtij.nl \
--to=m@rtij.nl \
--cc=adam@sccode.com \
--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.