Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a server set up with Ubuntu 12.04. I've installed OpenSSH, and I'm trying to access it from another computer, on another network, using this command (modified for the correct values):

ssh username@192.168.0.X

I am able to connect when I'm on any other computer in the same network, but when trying to ping my servers IP from a different network all I get is:

Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
ping: sendto: No route to host
Request timeout for icmp_seq 4
ping: sendto: Host is down
Request timeout for icmp_seq 5
ping: sendto: Host is down
Request timeout for icmp_seq 6
ping: sendto: Host is down
Request timeout for icmp_seq 7
ping: sendto: Host is down
Request timeout for icmp_seq 8
ping: sendto: Host is down
Request timeout for icmp_seq 9
ping: sendto: Host is down
Request timeout for icmp_seq 10

Through my searching I learned ping is sometimes not reliable, so I tried telnet my_ip, and it was still unable to connect.

I'm assuming this is an issue with the router, possibly a firewall, but I'm unsure of what it could be.

I made sure port 22 was open using http://www.yougetsignal.com/tools/open-ports/

The network the server is on runs off a Netgear router. ifconfig (Ubuntu Terminal):

eth0      Link encap:Ethernet  HWaddr 6c:3b:e5:b8:64:3e  
          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::6e3b:e5ff:feb8:643e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:83734 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47851 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:35300099 (35.3 MB)  TX bytes:6103273 (6.1 MB)
          Interrupt:16 

eth1      Link encap:Ethernet  HWaddr 6c:3b:e5:b8:64:3f  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:456 errors:0 dropped:0 overruns:0 frame:0
          TX packets:456 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:49255 (49.2 KB)  TX bytes:49255 (49.2 KB)

The network I'm trying to access from runs off a Verizon router. ifconfig (Mac Terminal):

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=3<RXCSUM,TXCSUM>
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=2b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4>
    ether a8:20:66:07:eb:a4 
    media: autoselect (none)
    status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 20:c9:d0:32:05:02 
    inet6 fe80::22c9:d0ff:fe32:502%en1 prefixlen 64 scopeid 0x5 
    inet 192.168.1.69 netmask 0xffffff00 broadcast 192.168.1.255
    media: autoselect
    status: active
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
    lladdr 00:3e:e1:ff:fe:7a:36:b0 
    media: autoselect <full-duplex>

What else could be causing this issue?

share|improve this question

closed as off-topic by Falcon Momot, Ward, Scott Pack, Jenny D, kce Jul 7 '13 at 0:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about hardware or software used in a home setting are off-topic because they require answers that may not be practical for the business and support professionals here. You should try asking on Super User instead." – Falcon Momot, Ward, Scott Pack, Jenny D, kce
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Please describe the network(s) in sufficient detail. –  Michael Hampton Jul 6 '13 at 0:32
    
I added the ifconfig for each network. Let me know if there's any other details you need. –  iRector Jul 6 '13 at 0:52
    
@iRector show us the command that you're using to SSH into the box. If it's something like ssh user@192.168.0.x, and you're not on the same network, you're doing it wrong. –  strugee Jul 6 '13 at 0:59
    
@strugee Yeah, I am using ssh username@192.168.0.X What would the correct usage be for an outside network? Also I feel being unable to ping 192.168.0.X from a different network could make it an issue with the router.. just don't know what that issue could be. –  iRector Jul 6 '13 at 1:06
    
@iRector I'll add it in an answer. –  strugee Jul 6 '13 at 1:12

2 Answers 2

up vote 1 down vote accepted

tl;dr: you need to configure port forwarding on your router, or set your SSH server outside the DMZ, or something like that. Then, use your router's IP address instead of your server's.

Based on your comment, you are using ssh [user]@192.168.0.[some number]. This will only work if you're connected to the same network.

Why? Because (probably, AFAIK) your router has a public IP and each of the computers inside your network have a private IP. Your public IP looks like this: 71.32.87.80. It's pretty random, and changes occasionally. Your private IP looks like what you typed in your SSH command; it was assigned to your computer by your router when you connected. Every computer that uses a given router is assigned a private IP.

However, because traffic goes through your router, traffic acts as if it's come from your router, and hence, your public IP. This is why if a website uses logic based on IP addresses, every computer inside the network will look the same. This is also where the notion of private and public IPs came from: your public IP is the one everyone sees. No one except your router sees your private IP.

Let's say your server is connected to Router A. When you're on Router A, and you connect to 192.168.0.x, you're connecting to a computer that's also connected to Router A - your server. When you're not on Router A - let's say you're on Router B instead - and you connect to 192.168.0.x, you're connecting to some computer that's connected to Router B - not your server. Your connection never even leaves Router B's network.

Because of this you need to connect to Router A's public IP, not your server's private IP. Then, you need to configure Router A to forward inbound traffic to your server. This effectively makes Router A's IP act as your server's IP for inbound traffic.

Note: I realize that explanation was not the greatest in terms of being easy to understand. Please let me know what I can do to improve it.

share|improve this answer
    
Haha feel like I should have realized that, but thank you very much for your detailed explanation! –  iRector Jul 6 '13 at 1:43
    
any time, really! –  strugee Jul 6 '13 at 1:47

Sounds like a possible netfilter issue to me. Did you check if your Netgear is forwarding port 22 to your server?

If you have a GUI installed add package gufw, if not I'm sure there's a way from command line, I'm just not a Ubuntu guy.

Then make sure your allowing access from "all" on port 22, or even better if you know your remote IP(s) add them as allow rules to keep you safer.

share|improve this answer
    
The server's Netgear router is forwarding port 22. The gufw install was giving me issues (using sudo apt-get install gufw), so I'm resetting the server, and I'll let you know after I configure the firewall... (I have Ubuntu's GUI installed) –  iRector Jul 6 '13 at 1:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.