LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2003, 01:31 AM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Ssh port forwarding?


I want to let computers on LAN1 connect to port 7000 (a win tcp/ip server) of a computer located in a subnet of LAN2.
The network layout is like this:
Code:
                         server1   <-LAN1              LAN2->   server2                                             server3
 subnet1 - [192.168.0.65 FW+NAT1 x.x.x.x] - internet - [y.y.y.y FW+NAT2 192.168.226.1] - servernet - [192.168.226.2 FW+NAT3 192.168.0.65] - subnet2 - [192.168.0.67]
The task is more precisely: any machine on subnet1 of LAN1 should be allowed to connect to port 7000 of a machine (192.168.0.67) on subnet2 of LAN2, whilst going through three servers doing firewall and nat.
I could establish a working natd redirect rule on server3 to redirect 192.168.0.67:7000 to 192.168.226.2:7000. So, I can connect to 192.168.0.67:7000 via 192.168.226.2:7000.
I tried a chain of port redirections, but no furher port redirections seem to work.
I wonder if I could use ssh port forwarding for the task, as ssh is on servers 1, 2 and 3 (but it is not on the windows server 192.168.0.67).
I already made some attempts with ssh port forwarding, too, with no success. (I think I could not grasp the principles of ssh port forwarding, since I could not establish even the simplest one inside LAN2)
Could you help me?

Last edited by J_Szucs; 10-29-2003 at 01:49 AM.
 
Old 10-29-2003, 04:42 AM   #2
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
I had a little success in port forwarding in the meantime. I issued the following command on serverA:
ssh -L8080:serverB:80 serverB

Now, when I am logged into serverA, I can connect to localhost:8080 and see the web page on serverB.

This, however only works on localhost, and I cannot do the most important: connect to serverA:8080 and see serverB:80 there.
When I tried to connect to serverA:8080 from any other host, my browser gave me "page unavailable" error.

So, is it possible to setup a secure tunnel with ssh between two servers so that clients can make use of the tunnel?
I mean: a client close to serverA connects to serverA:8080, but it actually connects to serverB:80 via the ssh tunnel (port forwarding).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH Port Forwarding wwnexc Linux - Networking 4 09-29-2005 01:26 AM
SSH Port forwarding WRSpithead Linux - Networking 1 04-18-2005 04:09 AM
Port forwarding for ssh Adriaan Linux - Networking 1 03-08-2004 09:11 AM
Help with Port Forwarding for SSH mi6 Linux - Networking 6 07-29-2003 12:46 PM
SSH port forwarding tarballedtux Linux - Networking 2 05-29-2002 07:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration