Enable/disable
ufw enable
ufw disable
Status
ufw status verbose
ufw status numbered
ufw show raw
ufw show added
ufw default deny incoming
ufw default allow outgoing
ufw logging on
ufw app info CIFS
Allow
ufw allow 53
ufw allow 53/tcp
ufw allow 53/udp
# ufw allow from <target> to <destination> port <port number>
ufw allow from 192.168.0.4 to any port 22
# ufw allow from <target> to <destination> port <port number> proto <protocol name>
ufw allow from 192.168.0.4 to any port 22 proto tcp
ufw allow from 192.168.1.0/24 to any proto tcp port 8081
ufw allow from 192.168.1.0/24 to any proto udp port 1900
ufw allow from 192.168.1.0/24 to any port 1900/udp
ufw allow in on eth1 from 192.168.1.2 to any port 22 proto tcp
ufw allow from 192.168.1.0/24 to any app IPP
Allow multicast and IGMP
ufw allow in proto udp to 224.0.0.0/4
ufw allow in proto udp from 224.0.0.0/4
ufw allow out proto udp to 224.0.0.0/3
ufw allow out proto udp to ff00::/8
ufw allow in proto udp to 224.0.0.0/3
ufw allow in proto udp to ff00::/8
/etc/ufw/before.rules:
# allow IGMP
-A ufw-before-input -p igmp -d 224.0.0.0/4 -j ACCEPT
-A ufw-before-output -p igmp -d 224.0.0.0/4 -j ACCEPT
/etc/ufw/user6.rules:
# allow IGMP
-A ufw6-before-input -p icmpv6 -d ff00::/8 -j ACCEPT
-A ufw6-before-output -p icmpv6 -d ff00::/8 -j ACCEPT
Deny
ufw insert 1 deny from 192.168.10.0/24