README: example

This commit is contained in:
Daniel Brahneborg 2025-12-04 17:18:06 +01:00
parent 6799cb9846
commit 77e26ef721

View file

@ -45,3 +45,14 @@ Then simply add additional commands as needed.
tr '[]' ' ' |
awk '{print $2}' >> autofw.badips
The output is a list of UFW commands.
Here we assume we have blocked a.b.c.115 and a.b.c.116, and whitelisted e.f.g.h.
The reason we first delete the rule for e.f.g.h and then add it back, is to make sure it comes first.
This way whitelisted addresses can never be blocked.
yes | ufw delete deny from a.b.c.115/32
yes | ufw delete deny from a.b.c.116/32
ufw insert 1 deny from a.b.c.112/29
yes | ufw delete allow from e.f.g.h/32
yes | ufw insert 1 allow from e.f.g.h/32