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 防火牆操做