# Can't access web server outside network



## Harley (May 7, 2013)

I can view the pages without fail locally, but can't access them from outside the network.

resolv.conf

```
Generated by resolvconf
nameserver 192.168.1.1
```

hosts

```
::1                     localhost localhost.mydomain.net
127.0.0.1               localhost localhost.mydomain.net
192.168.1.1             ns1.mydomain.net
```

hosts.conf

```
# Auto-generated from nsswitch.conf
hosts
dns
```

Forwarded port 80 in my router to my server, not sure what to try next.

I'm on Suddenlink.


----------



## SirDice (May 7, 2013)

Run tcpdump(1) on the server and try and connect from outside of your network. You should see the packets come in. If there are no packets coming in your forwarding rule on your router may not be correct or your ISP blocks access to it.

Something like this should get just the port 80 traffic: `# tcpdump -ni re0 tcp and port 80`


----------



## Harley (May 8, 2013)

Ok, I ran `# tcpdump -ni re0 tcp and port 80`. It produced no information whatsoever when *I* tried to access the site.

I've had this server online and running web pages with no problem before, I'm missing something somewhere.


----------



## usdmatt (May 8, 2013)

When you say 'working locally' do you mean from the machine itself or from another computer on the local network?

The two most obvious reasons I can think of why you wouldn't be able to access the website from external are:

It's only listening on localhost (although if it's working from other computers on your LAN this is unlikely to be the culprit). Running a `netstat` as below should confirm that the web server is listening on port 80 on all interfaces (*:80) -


```
# netstat -an -f inet
tcp46      0      0 *.80                   *.*                    LISTEN
```

The default gateway is not right on the web server. Unless you have firewalls configured to stop it, you should be able to ping something on the Internet (such as Google's DNS servers - 8.8.8.8) from the web server.
Other than that I'd be guessing at firewalls stopping it, or misconfiguration of the router forwarding.


----------



## SirDice (May 8, 2013)

If there are no packets coming in the problem is either with the router or with your ISP. Regardless of how the FreeBSD box is configured you should see packets coming in. If the FreeBSD box isn't configured correctly the responses wouldn't work but you'd still get packets coming in.


----------



## Harley (May 8, 2013)

Well, Suddenlink must have changed something.

`#netstat -an -f inet`

```
tcp4      0      0 *.80                   *.*                    LISTEN
```

So, it is listening on the port, I've double checked everything in the router, *I* plugged directly into the modem to no avail.

They have changed blocking port 80 in the last few months then.

Yep, *I* changed it to port 8080 and it worked fine, oh well.


----------



## usdmatt (May 8, 2013)

Have you changed router (or reset the one you're using)?

Some routers require changing the management port from 80 (usually the default) to something else before forwarding port 80 will work (almost certainly the case if your router has remote management enabled).


----------

