IP connection (firewall)?

Raphaƫl Berbain raphael.berbain at gmail.com
Thu May 4 17:55:56 UTC 2006


* Russell Blau:

> I am trying to run a private HTTP server on my Ubuntu machine, for use in
> developing and testing a web application.  Because I want it to be private,
> I am running it on a random high-numbered port.  My computer is behind a NAT
> firewall, so I've set it to forward this one port to my Ubuntu box.
>
> Problem is, I cannot connect to the HTTP server, either from another machine
> on my local network or from the Internet.

Do you want it to be private or do you want to be able to connect from
the internet?  It's not clear what you are trying to achieve from your
decription.

> Even weirder, I *could* connect to it from my local network at one
> point, but this no longer works.

So what did you change?


> [...]
>
> I can connect to the server using Firefox on my Ubuntu machine
> (http://localhost:54321/ works).  However, even from my Ubuntu machine,
> http://myipaddress:54321/ doesn't work.

Shot in the dark:  The web server is listening on the loopback address
only.

> I can connect to other ports on my Ubuntu machine from the Internet, so I
> know the port forwarding is set up correctly.  In fact, trying
> http://myipaddress:54321/ , which is the port I want to use, returns a
> "connection refused" error, but trying http://myipaddress:54322/ , which is
> a port that is *not* opened in my NAT firewall, results in "connection timed
> out."

Given that you can't reach http://myipaddress:54321 from the web
server host, it seems logical you can't reach it from another host.
(You could set up a box that way, but you'd have to do it on purpose).

What I am trying to say is there's no point trying to troubleshhot
from-the-lan and from-the-internet connection as long as
from-localhost doesn't work.

> "netstat -an" shows that the server program is indeed LISTENING on port
> 54321.

As noted above, first check with netstat on which interfaces the web
server is listening.  If it's listening on the box external interface,
then something else is to blame and you'll have to provide more
details, such as the web server you use, its configuration, 'ifconfig'
and 'netstat -nlt' output.  Also, have a look at the log files,
especially the web server logs.






More information about the ubuntu-users mailing list