Linux common commands-48: ufw

ufw program is used to manage firewalls. Compared with iptables , it is easier to use. By default, sudo apt install ufw needs to be manually installed.

Syntax format: ufw [parameter]

Common parameters:

Example

 # 启动ufw enable # 关闭ufw disable # 重启ufw reload # 显示防火墙状态及规则ufw status # 重置配置ufw reset # 允许外部访问80端口ufw allow 80 # 禁止访问80端口ufw delete allow 80 # 只允许特定网段访问ufw allow from 172.21.2.10/24

This article is reprinted from https://xugaoxiang.com/2022/06/14/linux-cmds-48-ufw/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment