参考:https://blog.csdn.net/qq_33764934/article/details/110133011
Ubuntu系统的默认防火墙系统是ufw,但是可以安装和使用Firewalld。
【安装】
sudo apt-get install firewalld -y
设置开机启动:
systemctl enable firewalld
启动服务:
systemctl start firewalld
查看服务状态:
service firewalld status
输出:
● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/lib/systemd/system/firewalld.service; enabled; vendor pre> Active: active (running) since Fri 2022-11-18 12:12:36 UTC; 13min ago Docs: man:firewalld(1) Main PID: 3464 (firewalld) Tasks: 2 (limit: 2256) Memory: 23.9M CPU: 667ms CGroup: /system.slice/firewalld.service └─3464 /usr/bin/python3 /usr/sbin/firewalld --nofork --nopid