By softwar66
I have upgraded my droplet from 12.04 to 16.04.01 LTS. As soon I enable UFW nothing works, no SSH, no web. Rules were reapplied, like they were in previous system, see below, I have flushed iptables, reinstalled UFW. Can´t figure out what else it can be? Also when I reboot system UFW is diabled.
-A ufw-user-input -p tcp --dport 80 -j ACCEPT
-A ufw-user-input -p tcp --dport 443 -j ACCEPT
-A ufw-user-input -p tcp --dport 25 -j ACCEPT
-A ufw-user-input -p tcp --dport 22 -j ACCEPT -m comment --comment ‘dapp_OpenSSH’
-A ufw-user-input -p tcp --dport 22 -j ACCEPT -A ufw-user-input -p udp --dport 22 -j ACCEPT
-A ufw-user-input -p tcp --dport 25 -j ACCEPT -A ufw-user-input -p udp --dport 25 -j ACCEPT
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!
Have you enabled your firewall to allow HTTP? Port 80?
I had a similar issue where when I enabled my firewall with sudo ufw enable I could no longer access my website from the browser.
I solved this issue by allowing port 80, which is the port number assigned to the HTTP protocol.
$ sudo ufw allow 80
To allow ssh to work you can run:
$ sudo ufw allow ssh
I hope this is helpful.
Thanks for answer.
Still I can´t make this work. After Ubuntu upgrade to 16.04.01 I can not make sites running. With UFW disabled everything works. What else it can be? I am simply out of ideas.
UFW output is set so: http://pasteboard.co/fLsA7c731.jpg
Have read both articles mentioned above. Have set same setup some time ago on 14.04.
You can try adding rules to UFW before enabling it. You can enable application by port or by it’s name. Some applications can register their profiles with UFW, so UFW can manage them by name.
Executing
- sudo ufw app list
Sample outputAvailable applications:
Apache
Apache Full
Apache Secure
OpenSSH
To be able able to use SSH, you need to allow it before enabling UFW:
- sudo ufw allow OpenSSH
Same can be done by enabling port, instead of name:
- sudo ufw allow 22/tcp
Now, when you enable UFW (sudo ufw enable), SSH should be working. You should allow your web server, so you can access it.
UFW is IPtables configuration tool, this rules should still persist, but you can try adding rules to UFW too.
Following articles can help you understanding UFW:
How To Set Up a Firewall with UFW on Ubuntu 14.04.
UFW Essentials: Common Firewall Rules and Commands.
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.