Question

WAF is blocking traffic

So I tried setting up a web access firewall. On the first firewall, all ports were open. I changed it to SSH 22, port 4000 (webserver), 27017(modgod and mongose). The mobile app isn’t able to connect. What step am I missing? When I’ve done an nmap and netstat scan the ports are said to be closed.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
June 28, 2022

Hi there,

In order for you to be able to access those services externally, besides allowing the ports via your firewall, you need to make sure that they bind on 0.0.0.0 rather than 127.0.0.1.

You can verify if this is the case with the following command:

netstat -plant | grep 4000

For example, if you want to access your MongoDB externally, you can do that by following the steps here:

https://www.digitalocean.com/community/tutorials/how-to-configure-remote-access-for-mongodb-on-ubuntu-20-04

For the service that is listening on 4000, can you confirm what type of service is it?

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.