Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 recently installed Ubuntu Server on an old machine, to set up a website with family photos etc. It is connected to the Internet via my home router (WRT160Nv2). I set the connection up with a static IP address (, set forwarding rules on the router (for port 80). Apache2 is set up to listen on port 80 (and it does).

I can view the website from within the local network (just typing in in the browser on any computer behind the router), but it's invisible from the outside. Ports are forwarded correctly, when I forwarded them to another machine within the network, it's visible from the outside. It has to be some problem with this server, it blocks all connections from external addresses. Why? This is not just a problem with port 80, all ports seem closed from the outside. The built-in firewall (UFW) is active, but set to allow all connections (I tried disabling it, no change). No help from netstat either.

root@czarny:~# netstat -an | grep "LISTEN "
tcp        0      0*               LISTEN
tcp        0      0   *               LISTEN
tcp        0      0   *               LISTEN
tcp        0      0   *               LISTEN
tcp        0      0    *               LISTEN
tcp        0      0    *               LISTEN
tcp        0      0    *               LISTEN
tcp        0      0   *               LISTEN
tcp        0      0   *               LISTEN
tcp        0      0   *               LISTEN
tcp6       0      0 :::8080                 :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0          :::*                    LISTEN
root@czarny:~# ufw status
Status: active

To                         Action      From
--                         ------      ----
Apache                     ALLOW       Anywhere
Postfix                    ALLOW       Anywhere
Dovecot POP3               ALLOW       Anywhere
Dovecot IMAP               ALLOW       Anywhere
Dovecot Secure IMAP        ALLOW       Anywhere
Dovecot Secure POP3        ALLOW       Anywhere
Postfix Submission         ALLOW       Anywhere
OpenSSH                    ALLOW       Anywhere
Apache Full                ALLOW       Anywhere
share|improve this question

closed as too localized by Jorge Castro, Oli Dec 9 '11 at 21:32

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

I know this was closed because "This question is unlikely to help any future visitors", but it just helped me. This was an easy fix that isn't apparent at first glance. – AAA Feb 12 '15 at 20:30

Oh, I feel stupid now. It was a typo in network configuration (/etc/network/interfaces), wrong default gateway.

share|improve this answer
You may accept your own answer if the question is solved. – marenostrum Oct 21 '10 at 18:41