UFW is a very friendly application that allows you to specify things as easy as
ufw allow app OpenSSH
but beeing a "super user" and very security aware I don't like "anywhere" rules. I'd rather do :
ufw limit proto tcp from 188.8.131.52 to any port 22 ufw allow proto tcp from 192.168.0.0/24 to any port 22
But when you specify a lot of IPs or networks, things are getting a bit messy. Things get even messier when you need to allow several ports / proto for the same networks.
Does UFW supports variables / macros ?
ufw set WORK_IP 184.108.40.206 ufw set HOME_NET 192.168.0.0/24 ufw limit proto tcp from $WORK_IP to any port 22 ufw allow proto tcp from $HOME_NET to any port 22
(and, of course, getting something similar from