Ubuntu server refusing connections via port forwarding

port-forwardingrouterUbuntu

Getting some really weird behavior from our Ubuntu server… it's behind a Verizon router firewall with port forwarding (port 8080 to port 80 on the server), and we've been having issues accessing it via this external IP. From within the network, it appears to respond normally (I can access it via web browser and SSH), but refuses connections through port forwarding (using our static external IP). The strangest thing is that it actually responds to external port-forwarded connections right after being restarted, but quickly lapses back into this pattern of refusing external connections.

I'm a bit of a server newbie (I'm actually a programmer in a small startup that just lost their server ops guy, urgh) so this is all trial by fire for me. Does anyone have any advice on what could be going wrong here? Any help would be appreciated, thanks.

EDIT:

We have another server being forwarded on port 80, and it hasn't had any accessibility problems. So now I'm beginning to think it's a problem with the server. But what would prevent a server from accepting port-forwarded connections?

EDIT 2:

Okay, now this is really bizarre… it seems that the :8080 external address works in my browser immediately after I SSH into the server via the local IP in the terminal… and then it stops working shortly thereafter. Any idea what could be behind this?

Best Answer

Does restarting the ubuntu server or the verizon firewall make it start working again temporarily?

To check the status of your firewall rules, use

sudo /sbin/iptables -nvL |less

what do you see there? Save that output right after restart and then compare to when it stops working - is some other process mucking with your firewall rules (via crontab maybe)? Seems odd, but that could explain the behavior you are seeing.

Related Topic