$ sudo ufw allow 1000:2000/tcp
$ sudo ufw allow from 192.168.1.104
Instead of allowing access to single ports UFW also allows us to access to port ranges
To allow access on all ports from a machine with IP address
or allow access on a specific port from a specific source
$ sudo ufw allow from 192.168.1.104 to any port 22
or block access from a specific subnet
$ sudo ufw deny from 192.168.1.0/24