Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have netgear router. Initially I had forwarded all tcp ports to internal server 192.168.0.100 centos

I was able to ssh into that using my ssh user@publicip.

now I have installed Ubuntu trusty with IP 192.168.0.32 and forwarded all ports on router to that IP.

But I am not able to ssh from outside. I get error ssh: connect to host 12.15.14.44 port 22: Connection timed out.

I am able to ssh within internal network.

I have no firewall and no selinux enable in Ubuntu.

What else can I check?

Its not only ssh but port 80 is also not accessible

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:38758           0.0.0.0:*               LISTEN      31944/rpc.statd
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      7343/mysqld
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      692/rpcbind
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      21368/sshd
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      7911/postgres
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      7605/master
tcp6       0      0 :::47082                :::*                    LISTEN      31944/rpc.statd
tcp6       0      0 :::111                  :::*                    LISTEN      692/rpcbind
tcp6       0      0 :::80                   :::*                    LISTEN      20447/apache2
tcp6       0      0 :::22                   :::*                    LISTEN      21368/sshd
tcp6       0      0 :::25                   :::*                    LISTEN      7605/master
share|improve this question
    
Have you verified it is listening with netstat? – MaQleod Mar 14 '14 at 2:15
    
@MaQleod i have added netstat ouput – user1721949 Mar 14 '14 at 2:19
    
If it works internally on the network, then a netstat is not needed. An online port checker tool shows port 22 is closed on your external IP: yougetsignal.com/tools/open-ports - Double check your port forwarding – Tillman32 Mar 14 '14 at 2:20
    
@Tillman32 yes my port 80 is also coming as closed. how can i open it – user1721949 Mar 14 '14 at 2:23
1  
Not sure about apache2, i'm not that familiar with the config for it. The next step for ssh would be to run tcpdump -i <iface_name> port 22 on the box and then attempt a connection. The traffic (or lack thereof) should help narrow down the problem. – MaQleod Mar 14 '14 at 2:57
  • first use tcpdump to make sure that ubuntu doesnt get the traffic, then if not..
  • ..change IP of the centos from 192.168.0.100 to another free IP, 192.168.0.2xx,
  • add an alias to ubuntu, so that is has 192.168.0.32 AND 192.168.0.100 in the same time and
  • try sshing from outside. if it works then the problem with the netgear is that it still forwards connections to the old IP
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .