对指定ip开放指定端口:
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="xxx.xxx.xxx.xxx" port port="xxx" protocol="tcp" accept"
对指定ip关闭指定端口:
firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="xxx.xxx.xxx.xxx" port protocol="tcp" port="xxx" accept"
重启后生效:
systemctl restart firewalld.service
列出全部生效的防火墙配置:
firewall-cmd --list-all
开放指定端口:
firewall-cmd --zone=public --add-port=8848/tcp --permanent
关闭指定端口:文章来源:https://www.toymoban.com/news/detail-810883.html
firewall-cmd --zone=public --remove-port=8848/tcp --permanent文章来源地址https://www.toymoban.com/news/detail-810883.html
到了这里,关于防火墙firewalld 开启关闭端口的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!