All of lore.kernel.org
 help / color / mirror / Atom feed
* DNAT w ssh tunnel
@ 2002-06-21  7:28 eth
  2002-06-21  7:49 ` Karl Fischer
  0 siblings, 1 reply; 2+ messages in thread
From: eth @ 2002-06-21  7:28 UTC (permalink / raw)
  To: netfilter

Hi listers.

I try to make a simple tunnel for a jdbc connection with port forward from one machine to another via a firewall.

|client| --Inet--> |firewall| --LAN--> |database|

The client runs a ssh client with port forwarding to the firewall machine. On the fw I have the "simpleproxy" which is a tcp proxy that forwards all local sockets to a remote host. Yet I thought I should do a:

iptables -t nat -A OUTPUT -d 194.226.254.1 -p tcp -m tcp --dport 1521 -j DNAT --to-destination 192.168.10.100:1521

... which should do the fw->database port forward trick; it doesn't. :-|

Dumping, it looks like packets leave from 192.168.10.1 (which is internal eth firewall) to 192.168.10.100 (which is the database server) , the server says SYN ACK and then the firewall sends a RST !! Why? Isn't DNAT supposed to keep track of all connection even those DNATed? What am I missing? The linux part is a RH 7.3 with a 2.4.18 from kernel.org.






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: DNAT w ssh tunnel
  2002-06-21  7:28 DNAT w ssh tunnel eth
@ 2002-06-21  7:49 ` Karl Fischer
  0 siblings, 0 replies; 2+ messages in thread
From: Karl Fischer @ 2002-06-21  7:49 UTC (permalink / raw)
  To: eth; +Cc: netfilter

eth wrote:
> 
> Hi listers.
> 
> I try to make a simple tunnel for a jdbc connection with port forward from
> one machine to another via a firewall.
> 
> |client| --Inet--> |firewall| --LAN--> |database|
> 
> The client runs a ssh client with port forwarding to the firewall machine.
> On the fw I have the "simpleproxy" which is a tcp proxy that forwards all
> local sockets to a remote host. Yet I thought I should do a:
> 
> iptables -t nat -A OUTPUT -d 194.226.254.1 -p tcp -m tcp --dport 1521 -j
> DNAT --to-destination 192.168.10.100:1521
> 
> ... which should do the fw->database port forward trick; it doesn't. :-|

Hi, 

you don't even need to use netfilter's port-forwarding and also no
simpleproxy. SSH does all the job on it's own and most secure too ...

on the client you use:

ssh -L 1521:192.168.10.100:1521 user@firewall

then your database frontend on the client should be able to connect to
the database using the localhost interface 127.0.0.1:1521 - that's it.

Regards
- Karl




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-21  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-21  7:28 DNAT w ssh tunnel eth
2002-06-21  7:49 ` Karl Fischer

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.