Loading

Ubuntu20.04 防火墙设置

LInux原始的防火墙工具iptables由于过于繁琐,所以ubuntu系统默认提供了一个基于iptable之上的防火墙工具ufw。

安装:

apt install ufw

正常情况安装以后应该是默认禁止状态的,输入 ufw status verbose命令可以看到如下界面:

ufw status verbose

status:inactive

开启/关闭防火墙:

ufw enable

ufw disable

ufw default deny (关闭所有端口)

开启或关闭某个端口

ufw allow 80 //允许80

ufw deny 80 //拒绝80

ufw allow from 192.168.20.1 允许此IP访问本机所有端口

 

posted @ 2022-02-20 17:00  Allfuture  阅读(243)  评论(0编辑  收藏  举报