LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-18-2003, 02:08 PM   #1
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
SSH, VNC and a Linksys Router


I'm not exactly sure if this is a Linux problem or a Linksys problem....

My LAN connects to the internet through a Linksys router. I've got ssh and VNC set up on my linux box so that VNC has to go through an ssh tunnel to work. From inside my lan, everything is fine; VNC won't connect unless I have an ssh tunnel set up. However, from the internet, I can't get VNC to run. I've got port 22 forwarded from the Linksys router to the linux box so when I use Putty to connect to the external IP address at the router, I get a connection to the linux box. This works just fine. However, VNC absolutely will not connect. In setting up the Putty tunnel, I use the lan ip address of the linux box (192.168.1.x) and I suspect that this is the source of the trouble.

So, does anyone know a way to connect to the vncserver and still run VNC through the SSH tunnel? Or do I just need to quit bitchin and just use the console?
 
Old 04-18-2003, 02:11 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Does the ssh connection fail or connect?
 
Old 04-18-2003, 02:20 PM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803

Original Poster
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
SSH connects without a problem, both from inside the lan and from the internet. When I connect from the lan, I point Putty at the ip address of the linux box. When I connect from the internet, I point Putty at the ip address of the router and let it forward to the linux box.
 
Old 04-18-2003, 02:24 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Then I can't see why there would be a problem - using VNC over ssh will only use port 22. Are you using the same command from inside and out except for the ip address on the ssh command? I take it you are connecting to with VNC - "127.0.0.1:1" ?
 
Old 04-18-2003, 02:53 PM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803

Original Poster
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Yes, the only difference is the IP address Putty uses to connect. VNC uses "localhost:2", but I use that both inside the lan (where is works) and outside the lan (where it doesn't).

I guess I'm wondering if the IP address change is the cause. When I'm within my lan, the Putty connection and the forwarding tunnel use the same IP address (192.168.1.x) while when I'm trying to connect from the internet, Putty uses the router IP address while the forwarding tunnel still uses the lan IP (192.168.1.x). My suspicion is that since Putty is connected to the router IP address, it really doesn't know what 192.168.1.x is and therefore doesn't know where to forward. In other words, when something shows up on port 5902, Putty doesn't know what to do with it because in this context 192.168.1.x doesn't make any sense.
 
Old 04-18-2003, 02:56 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
ah - are you using the same client machine from inside and out?

Do you have localhost in the hosts file of the external machine? Try using 127.0.0.1 instead. I'm heading out now but I'll keep thinking of other possibilities (I think better in the pub )
 
Old 04-18-2003, 03:00 PM   #7
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
As for your second para - from the ouside you never use a 192 addy you use the external ip and the ssh connection works fine so I can't see how that would be a problem.
 
Old 04-18-2003, 03:30 PM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803

Original Poster
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
And you are completely correct, there shouldn't have been a problem.......and I'm feeling like a proper idiot. The problem wasn't in how I described the connection, the problem was that I hadn't actually implemented what I described.

Now for the mea culpa:

In my previous posts I said that the forwarding tunnel was using the 192.168.1.x address. When I turned a critical eye to what I was doing, I found I had actually entered the IP address of the router. In other words, I was forwarding to port 5901 on the router. Needless to say, the router has absolutely no idea what to do with traffic on 5901 other than drop it. As soon as I changed the tunnel IP address to the 192 address, VNC worked like a charm.

I have GOT to start paying attention to what I type!


Thanks for your help david_ross, it is appreciated!! (Maybe I should try some of that thinking in the pub)
 
Old 04-18-2003, 04:58 PM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Cool - Glad you got it working - I came back for more money and thought I'd see how you were getting on
 
  


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 and VNC through Router poochdog Linux - Networking 3 08-30-2005 01:31 PM
VNC over SSH or ????? alirezan1 Mandriva 2 01-04-2005 10:55 AM
unstable HTTP/SSH server with Linksys router hamish Linux - Networking 0 07-22-2004 01:45 PM
SSH into Third box behind a linksys router. donk3 Linux - Networking 1 09-05-2003 01:02 PM
router problem with linksys router scheiße_comp Linux - Networking 10 08-20-2002 10:18 AM

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

All times are GMT -5. The time now is 06:46 AM.

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