Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to turn a laptop with a broken monitor into a home web server behind a wireless router (buffalo airstation). I removed all ubuntu gui packages and installed lighttpd. The laptop has a fixed ip address 192.168.7.180.

I set NAT on the router to forward port 22 to 192.168.7.100:22 and ports 80 and 8080 to 192.168.7.180:80.

Here is what I observe:

  1. wget 192.168.1.180 on another linux box connected by a wire to the router works fine, firefox 192.168.1.180 works too.

  2. ssh zzz.homelinux.org from outside of my network works fine, connecting me to 192.168.7.100 as expected.

  3. neither wget zzz.homelinux.org nor wget zzz.homelinux.org:80 from outside of my LAN work:

    Connecting to zzz.homelinux.org|XXX.XXX.XXX.XXX|:80... failed: Connection timed out.
    Connecting to zzz.homelinux.org|XXX.XXX.XXX.XXX|:8080... failed: Connection timed out.
    

So, what am I doing wrong?

share|improve this question

4 Answers 4

if 3 was conducted from inside your network, my top guess would be that your router does not have a feature known as NAT Loopback (also known as Loopback, Router Loopback and a few other names).

I would take a look in your router's configuration page to see if this can be turned on.

What you say is very normal and many off the shelf routers either do not have this feature or by default have it disabled - I needed to flash my Netgear router in order to provide this functionality.

Basically put, if you were to put your internal ip in to your hosts file, it would work fine - but, your router does not have a route or the ability set up in order to redirect an internal machine to a port on another internal machine via the external IP address.

You should get the same result by attempting to go to http://externalip:80 from an internal machine.

share|improve this answer
1  
He could use a hosts file if he does not have NAT Loopback. –  paradroid Sep 23 '11 at 1:09
    
@paradroid +1 ... I should have made that little test a bigger part of the answer as a possible solution! Long day... very tired! –  William Hilsum Sep 23 '11 at 2:16

Many ISPs block port 80 on consumer grade connections. Some routers also use port 80 for their own web interface and as such block the port from external connections.

The simplest solution is to use an alternate port (in both situations) - and maybe use a dynamic dns service that handles port redirection. If its the router, you might be able to configure it to passthrough port 80 but that's router specific - it would involve turning external administration off, or switching its port

share|improve this answer

If your router does not have NAT Loopback, as Wil mentioned, you can add the following to the hosts file on all your LAN computers, so that they access the webserver from within your LAN, using the domain name:

192.168.7.180       zzz.homelinux.org
share|improve this answer

Is your router's Web interface on port 80/8080? Sometimes they have to be moved elsewhere so that NAT port routing to port 80/8080 on a device on the LAN makes it through.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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