I install this image: Ubuntu Docker 17.12.0~ce on 16.04, in ssh i run sudo ufw status verbose and get:
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), allow (routed)
New profiles: skip
To Action From
-- ------ ----
22 LIMIT IN Anywhere
2375/tcp ALLOW IN Anywhere
2376/tcp ALLOW IN Anywhere
22 (v6) LIMIT IN Anywhere (v6)
2375/tcp (v6) ALLOW IN Anywhere (v6)
2376/tcp (v6) ALLOW IN Anywhere (v6)
Ok to test that this firewall works i run some docker image on port 80 (nginx proxy):
sudo docker run -d -p 80:80 -e ENABLE_IPV6=true -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy:alpine
Theoretically I should be not able to connect to por 80 but when I go to browser and type droplet IP i see nginx screen - this means that firewall ufw NOT WORKS at all (!!!).
When I install pure Ubuntu image (without docker) and manually instal ufw and docker I get similar error.
So what I should do to make UFW firewall works ?
I try this:
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
But doesn’t work :(
Above error is very easy to reproduce - may be the ubuntu images are broken?
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!
This is accidental copy of below original question:
https://www.digitalocean.com/community/questions/ubuntu-ufw-firewall-not-working-at-all
I have the same problem. Example: in /etc/default/ufw its out allow and in deny. when i add “ufw allow ssh” and i try to connect… doesn work
Other example: if i change in /etc/default/ufw to allow in and out… then i try connect ssh, this work, buuut if i add “ufw deny ssh”… i continue connecting…
Please, help!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.