简体   繁体   中英

Can't connect despite port forwarding

I have a Ubuntu Server 16.04 running on a machine in my local network. The machine has static assigned IP and running apache2. There is no problem in connecting to it from my local network. I have port-forwarding for ports 22 and 80 setup on my router to the IP address of the machine. When I check the ports with my public IP address on sites like http://www.canyouseeme.org/ the result is that the ports are open. When I try to connect using my public IP address and using those ports the connections are refused. I tried disabling firewall in the router and also on the machine, no result.

What else should I try? It seems that the server is getting no incoming connection when I check with netstat.

Just for troubleshooting purposes:

  • Setup port forwarding on port 22 and try to ssh into your server using the public IP? If it works, it means apache is refusing the connections and not your router or ISP

  • On your router, setup the server on the DMZ temporarily and check if it works

  • Add another port forwarding rule on your router to redirect all http requests on port 8000,for example, to port 80 internally, then try to access your server with http://[public_ip]:8000

Have you changed anything on the apache2.conf file? Also, explain how you are testing the connection, internally using the public IP or from the Internet?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM