systemctl start firewalld.service
(如下红色字体须要根据实际状况修改)html
(1) Postgresql端口设置。容许192.168.142.166访问5432端口linux
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端口redis
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端口sql
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="11300" accept"
systemctl restart firewalld.service
firewall-cmd --list-all
示例:tcp
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
。post
+加关注rest
0code
0
« 上一篇:linux 7 防火墙操做