宇筱博客

  • 解决办法
  • 学无止境
  • 记录时光
  • 百宝箱
宇筱博客
点滴记忆,汇聚成海。
  1. 首页
  2. 学无止境
  3. 正文

firewalld对指定IP开放指定端口的配置

2018年1月9日 794点热度 0人点赞 0条评论

1. 打开firewalld防火墙

systemctl start firewalld.service

2. 添加防火墙规则(对指定ip开放指定端口)

(1) Postgresql端口设置。允许192.168.142.166访问5432端口

firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="5432" accept"

(2)redis端口设置。允许192.168.142.166访问6379端口

firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="6379" accept"

(3)beanstalkd端口设置。允许192.168.142.166访问11300端口

firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="11300" accept"

3. 重启防火墙,使配置生效

systemctl restart firewalld.service

4. 查看配置结果,验证配置

firewall-cmd --list-all

5. 删除规则

示例:

firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="11300" accept"

systemctl restart firewalld.service

---------------------

原文链接:https://blog.csdn.net/Qguanri/article/details/51673845?utm_source=copy

标签: 暂无
最后更新:2018年1月9日

小渔民

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2025 宇筱博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备15017825号-2