网站建设资讯

NEWS

网站建设资讯

Centos7-firewalld解决keepalived的VIP问题-创新互联

Centos7-firewalld解决keepalived的VIP问题

10年积累的网站制作、做网站经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先做网站设计后付款的网站建设流程,更有宁海免费网站建设让你可以放心的选择与我们合作。

firewalld 防火墙
语法命令如下:启用区域端口和协议组合
firewall-cmd [--zone=] --add-port=[-]/ [--timeout=]

此举将启用端口和协议的组合。
端口可以是一个单独的端口 或者是一个端口范围 -
协议可以是 tcp 或 udp。


查看 firewalld 状态
systemctl status firewalld


开启 firewalld
systemctl start firewalld


开放端口
// --permanent 永久生效,没有此参数重启后失效
firewall-cmd --zone=public --add-port=80/tcp --permanent

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


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


重新载入
firewall-cmd --reload


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


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


iptables 防火墙
也可以还原传统的管理方式使用 iptables
systemctl stop firewalld
systemctl mask firewalld


安装 iptables-services
yum install iptables-services


设置开机启动
systemctl enable iptables


操作命令
systemctl stop iptables
systemctl start iptables
systemctl restart iptables
systemctl reload iptables

保存设置
service iptables save

开放某个端口 在 /etc/sysconfig/iptables 里添加
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


新闻标题:Centos7-firewalld解决keepalived的VIP问题-创新互联
分享链接:http://cdweb.net/article/ecscd.html