1. 打開firewalld防火牆 2. 添加防火牆規則(對指定ip開放指定埠) (以下紅色字體需要根據實際情況修改) (1) Postgresql埠設置。允許192.168.142.166訪問5432埠 (2)redis埠設置。允許192.168.142.166訪問6379埠 (3)be ...
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