Can’t externally ping my server

Posted on

Problem :

I set up an a Ubuntu Server with LAMP and am trying to access it externally.

What I did:

  • I set up an account at no-ip.com following this article

  • I gave the server a local static ip of 192.168.1.127 and forwarded the port 80 and 22 (both externally and locally) to that ip adress. I also forwarded port 50005 external to port 80 internal.

  • I found my external ip via Portcheckers. To my understanding, the external ip is the same for all computers and routers on my network.

    The problem

  • I check ports 80, 22 and 50005 with portcheckers and all of them (along with all other major ports) were said to be unavailable.

  • I also tried to ping my server’s external ip from portcheckers and got Ping Failed: TimedOut
    I tried pinging the ip address from the terminal, but it froze after PING myhost.no-ip.org (66.XXX.XXX.XX) 56(84) bytes of data. When I tried to connect to the sever though my browser I got the Oops! Google Chrome could not connect to... message.

    Info

    I can connect to my server locally(192.168.1.127) through ssh, sftp, and http.

    I have a Linksys E320 router, and I disabled the firewall.

    Please let me know if I need to provide my external ip. Thanks for the help.

    EDIT

    I modified /etc/apache2/ports.conf to listen to port 50005 instead of 80 by replacing Listen 80 with listen 50005

  • Solution :

    WHY I AM WRONG

    I say that the reason you can’t ping is: the router never forwards the echo request to your server, but that doesn’t explain why the router itself doesn’t reply to the echo request. On my home network, I can ping my router directly (192.168.1.254), so why is it that when I try to ping it externally it doesn’t work?

    My best guess

    I’m still learning this, so this info may not be accurate.
    I largely got my answer from https://community.spiceworks.com/topic/85353-forward-pings-from-the-router-to-the-server-behind-it

    You’re inability to ping isn’t really your fault, but really the fault of the limited design of IPv4. I’m assuming your router has a designated IP address, and you have it set up to forward the ports 80, 22, and 50005 to some computer of your choosing; This is your router using Port Address Translation (PAT), which is a particular type of Network Address Translation (NAT).

    When you ping a server, ping transmits an Internet Control Message Protocol (ICMP) Echo Request message and waits for a return message.

    The problem is that ICMP is so low level that it doesn’t have ports. So your router is not forwarding the ICMP echo requests to your server, because your router is only forwarding ports, hence no ping.

    Instead of using ping to check if your server is up and running, you might be able to do a workaround with telnet 25. I haven’t set that up on my server yet so I’m not sure how to do that.

    I got it to work?
    Instead of doing port forwarding, I went to Firewall > IP Passthrough, and I changed my allocation mode from “Passthrough” to “Default Server”, and I set the default server as the internal IP that my laptop server is using (192.168.1.99).

    Now ping works. I’m honestly not sure if my situation is anything like your situation, so I hope to get a reply from you soon.

    Leave a Reply

    Your email address will not be published. Required fields are marked *