记住一些简单的就行.
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --remove-port=53/udp --permanent
开放TCP 80, permanent是永久开放.
完了reload一下.
firewall-cmd --reload
firewall-cmd --list-all

启用服务
systemctl start firewalld
有时候会提示"Failed to start firewalld.service: Unit is masked."

systemctl unmask firewalld
然后再重新启动一次服务

更详细的看:
https://wangchujiang.com/linux-command/c/firewall-cmd.html

标签: none

添加新评论