* Layer (5,6,7) based NAT
@ 2007-04-29 13:42 Adam
2007-04-29 16:33 ` Kirk Wallace
2007-04-29 16:50 ` Martijn Lievaart
0 siblings, 2 replies; 5+ messages in thread
From: Adam @ 2007-04-29 13:42 UTC (permalink / raw)
To: netfilter
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?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Layer (5,6,7) based NAT
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
1 sibling, 0 replies; 5+ messages in thread
From: Kirk Wallace @ 2007-04-29 16:33 UTC (permalink / raw)
To: netfilter
Adam
I was looking at this to solve another problem, but it may help you
solve yours?
http://l7-filter.sourceforge.net/
Kirk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Sun, 2007-04-29 at 07:42 -0600, 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?
>
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Layer (5,6,7) based NAT
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
2007-04-29 17:19 ` Jan Engelhardt
1 sibling, 1 reply; 5+ messages in thread
From: Martijn Lievaart @ 2007-04-29 16:50 UTC (permalink / raw)
To: Adam; +Cc: netfilter
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Layer (5,6,7) based NAT
2007-04-29 16:50 ` Martijn Lievaart
@ 2007-04-29 17:19 ` Jan Engelhardt
2007-04-29 17:20 ` Jan Engelhardt
0 siblings, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2007-04-29 17:19 UTC (permalink / raw)
To: Martijn Lievaart; +Cc: netfilter
On Apr 29 2007 18:50, Martijn Lievaart wrote:
> 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.
rinetd
Jan
--
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-04-29 17:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2007-04-29 17:19 ` Jan Engelhardt
2007-04-29 17:20 ` Jan Engelhardt
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.