firewalld基本配置
作者:
cnwinds | 来源:发表于
2020-04-07 18:50 被阅读0次
基本指令
# 启用防火墙
systemctl start firewalld.service
# 添加访问规则
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.0/24" port protocol="tcp" port="5432" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.143.0/24" port protocol="tcp" port="5432" accept"
# 让规则生效
systemctl restart firewalld.service
# 查看配置结果
firewall-cmd –list-all
# 删除规则
firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="192.168.142.0/24" port protocol="tcp" port="5432" accept"
# 让规则生效
systemctl restart firewalld.service
本文标题:firewalld基本配置
本文链接:https://www.haomeiwen.com/subject/icanphtx.html
网友评论