CentOS7下配置防火牆放過Keepalived

2021-09-29 10:43:58 字數 514 閱讀 5230

keepalived是乙個輕量級的ha集群解決方案,但開啟防火牆後各節點無法感知其它節點的狀態,各自都繫結了虛擬ip。網上很多文章講要配置防火牆放過tcp/112,在centos7下是無效的,正確的做法是配置放過vrrp協議,方法如下:

firewall-cmd --direct --permanent --add-rule ipv4 filter input 0 --destination 224.0.0.18 --protocol vrrp -j accept

firewall-cmd --direct --permanent --add-rule ipv4 filter output 0 --destination 224.0.0.18 --protocol vrrp -j accept

firewall-cmd --reload

keepalived使用vrrp組播,預設位址是224.0.0.18,因此要配置防火牆放過。

完成後再用ip addr檢視,集群已經正常了,只有主節點繫結虛擬ip,備份節點不會繫結了。

centos7防火牆配置

centos7防火牆配置 centos7使用的是linux kernel 3.10.0的核心版本,新版的kernel核心已經有了防火牆netfilter,並且firewalld的使用效能更高,穩定性更好。centos7配置防火牆的兩種方法 一 使用xml配置檔案的方式配置 方法一cp usr lib...

centos7防火牆配置

使用命令的方式配置centos7 防火牆 add firewall cmd permanent zone public add port 8080 tcp remove firewall cmd permanent zone public remove port 8080 tcp reload fi...

Centos7 防火牆配置

1 firewalld的基本使用 啟動 systemctl start firewalld 關閉 systemctl stop firewalld 檢視狀態 systemctl status firewalld 開機禁用 systemctl disable firewalld 開機啟用 system...