UFW防火墙配置

线上服务器配置

[shell]

ufw default deny # 默认禁止所有,下面才打开需要的

ufw allow 80 # 允许80端口,如果要开通mysql,allow 3306

ufw allow from 117.41.237.36 # 允许此ip访问所有端口

ufw allow from 61.164.186.241 # 内部3台服务器之间畅通无阻

ufw allow from 61.164.186.242

ufw allow from 61.164.186.246

ufw enable # 启动防火墙

ufw status # 查看服务状态

[/shell]

Status: active

To                         Action      From
--                         ------      ----
Anywhere                   ALLOW       117.41.237.36
Anywhere                   ALLOW       61.164.186.241
Anywhere                   ALLOW       61.164.186.242
Anywhere                   ALLOW       61.164.186.246
80                         ALLOW       Anywhere
22                         ALLOW       Anywhere

2 评论

发表评论