1. Home
  2. Helpful Tips
  3. UFW IP Blocking Doesn’t Work

UFW IP Blocking Doesn’t Work

If you’re having trouble with UFW failing to block IP addresses, make sure the priority of your rules is correct.

To show the priority ordering of ufw rules, do this:
$ sudo ufw status numbered


Status: active

To Action From
-- ------ ----
[ 1] OpenSSH ALLOW IN Anywhere
[ 2] 80 ALLOW IN Anywhere
[ 3] 443 ALLOW IN Anywhere
[ 4] 22 DENY IN Anywhere
[ 5] 11992 ALLOW IN Anywhere
[ 6] 3306 DENY IN Anywhere
[ 7] {ipaddress} Anywhere DENY IN

My IP deny rule was failing on the web because it was placed last.

Learn how to reorder the priority of UFW rules.

Updated on August 10, 2017

Was this article helpful?

Related Articles

Leave a Comment