ufw allow from 192.168.1.0/24

Category: Security & Hardening

ufw allow from 192.168.1.0/24

Allow all traffic from a private subnet

Permits every port for sources in the 192.168.1.0/24 network, handy for LAN-only services. The /24 is a CIDR mask covering 192.168.1.1 through 192.168.1.254. Restrict further by adding a port, for example ufw allow from 10.0.0.5 to any port 3306.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.