Allow Inbound Connections only from Local Network using UFW April 27, 2026 - by mahmood If you need both TCP and UDP for these ports: sudo ufw allow from 192.168.0.0/24 to any port 22 If you only need TCP (e.g., for SSH-style or custom services): sudo ufw allow from 192.168.0.0/24 to any port 22 proto tcp Verify and enable sudo ufw status numbered sudo ufw enable