查看状态:ufw status
打开ufw:ufw enable
关闭ufw:ufw disable
删除:
sudo ufw status numbered
sudo ufw delete 4
举例:
向IP 192.168.1.50打开53端口
ufw allow from 192.168.1.50 to any port 53
ufw allow from 114.114.114.114 to any port 100
ufw allow from 2300:3400:4300::/48 to any port 100
允许所有22访问:
sudo ufw allow 22