开启/关闭ufw
ufw enable
ufw disable
允许某端口被访问
ufw allow 80
禁止某端口被访问
ufw deny 8888
添加规则
允许10.168.2.137访问30004端口
ufw allow from 10.168.2.137 to any port 30004
插入规则
在第二条位置插入规则,允许192.168.1.1访问8888端口
ufw insert 2 allow from 192.168.1.1 to any port 8888
按编号显示规则
ufw status numbered
按编号删除规则
ufw delete 编号
