LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 02-01-2007, 10:49 PM   #1
BlueSpam
LQ Newbie
 
Registered: Dec 2003
Distribution: Ubuntu Server
Posts: 5

Rep: Reputation: 0
Can't connect to ssh from external network?


Hey all, I'm rather new to linux so forgive anything I say that sounds stupid.

I just installed ubuntu server on a machine in my internal network, with the intention to set it up as a development server with ssh, apache, and cvs. I have them all working on the internal network (eg from one machine to another) and I set up the port forwarding on my router to forward TCP and UDP ports 22 from the router to ubuntu box.

The problem I'm having is that if I try to ssh to the external IP, I get connection refused. I'm not sure where the problem is either, or how to go about fixing it. I checked canyouseeme.org and verified that it sees port 22 open on the external ip, so it's my belief that it's forwarding correctly. From what I've read so far I assume it might be related to NAT, but I don't really know enough to even start addressing this.
 
Old 02-01-2007, 10:56 PM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,747

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
You should be using TCP only, not UDP, for SSH. Though I don't think that would cause the problem.

I assume you have double checked the IP has changed since you configured the router? Better yet, have you configured this machine with a static IP? You could also try putting it into the DMZ, and seeing if you are able to connect then.
 
Old 02-01-2007, 11:02 PM   #3
BlueSpam
LQ Newbie
 
Registered: Dec 2003
Distribution: Ubuntu Server
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the quick reply. The machine is set up at a static ip, and I'm able to ssh to it just fine with another machine inside the network if I use it's internal ip, but not with the external one. I've also tried putting the system in the DMZ with no success.
 
Old 02-01-2007, 11:10 PM   #4
Sarteck
LQ Newbie
 
Registered: Feb 2007
Posts: 3

Rep: Reputation: 0
BlueSpam, hey, I'm also relatively new to Linux, so take anything I say with a grain of salt. ^_^ It seems to me, though, that it's your router that's the problem. To verify this, when you try to access the apache server from the external address, can you see the test page (or whatever page you've put up in place of it)?

If you can't, then what type of router do you have?
 
Old 02-01-2007, 11:19 PM   #5
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 306

Rep: Reputation: 32
It is most likely fine. If the canyouseeme.org page can hit port 22 the forwarding is working ok.

What kind of router do you have?

My guess is whatever firewall it has running is seeing a connection from a IP that is on its internal net trying to connect to its external interface, and is dropping the connection rather than forwarding the packing back inside. This is a good thing.

If you think about it, it is kind of counter productive to ask your router to forward the packets when the 2 computers are already on the same subnet.
 
Old 02-01-2007, 11:20 PM   #6
wildar
Member
 
Registered: Jan 2007
Distribution: Mandriva 2008, Mandrake 2005, Ubuntu 8.04.1
Posts: 239

Rep: Reputation: 30
If IP's all check good, then probably firewall in the router or on the server. Some routers may require opening the port for WAN to LAN in addition to port forwarding.

Check your server for firewall and the /etc/hosts.deny. hosts.deny might have an all:all line.
 
Old 02-01-2007, 11:55 PM   #7
BlueSpam
LQ Newbie
 
Registered: Dec 2003
Distribution: Ubuntu Server
Posts: 5

Original Poster
Rep: Reputation: 0
Hmm. I tried SSHing to an external server, then back in again to the external ip, and it worked! I guess I'll need to stick to the internal ip when I'm inside my network, no big deal though!

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables help! DROP ssh port, but allow to connect to ssh if from 2222 port kandzha Linux - Networking 4 09-13-2006 09:10 AM
ssh + pop3 with kmail: Could not connect to host localhost, but ok without ssh Emmanuel_uk Linux - Networking 0 07-20-2006 04:56 PM
ssh wont connect outside of local network clintonkerr Linux - Software 9 09-20-2005 07:35 AM
Can't ssh to external ip....please help... ksoma Linux - Security 7 08-12-2003 05:51 AM
Sample Working ipchain that allows http,ftp,ssh for internal and external network munisp Linux - Networking 1 11-09-2001 05:49 PM


All times are GMT -5. The time now is 05:04 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration