Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos7-firewalld solves the VIP problem of keepalived

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Centos7-firewalld solves keepalived VIP problems

firewalld

The syntax command is as follows: Enable zone port and protocol combinations

firewall-cmd [--zone=] --add-port=[-]/ [--timeout=]

This will enable a combination of ports and protocols.

A port can be a single port or a range of ports-.

The protocol can be tcp or udp.

View firewalld status

systemctl status firewalld

Open firewalld

systemctl start firewalld

open port

// --permanent takes effect permanently, without this parameter it will be invalid after restart

firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --zone=public --add-port=1000-2000/tcp --permanent

Keepalived VIP Questions

firewall-cmd --direct --permanent --add-rule ipv4 filter INPUT 0 --in-interface ens33 --destination 224.0.0.18 --protocol vrrp -j ACCEPT

reload

firewall-cmd --reload

Views

firewall-cmd --zone=public --query-port=80/tcp

delete

firewall-cmd --zone=public --remove-port=80/tcp --permanent

iptables firewall

You can also revert to traditional management using iptables

systemctl stop firewalld

systemctl mask firewalld

Install iptables-services

yum install iptables-services

Set up boot up

systemctl enable iptables

operation command

systemctl stop iptables

systemctl start iptables

systemctl restart iptables

systemctl reload iptables

save settings

service iptables save

Open a port Add it in/etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report