关于SUSE 12防火墙

系统SUSE Linux Enterprise Server 12 SP5 (x86_64)
 

1、打开/关闭/查看防火墙

防火墙的服务名称为:SuSEfirewall2.service
防火墙关停操作
systemctl start/stop/status SuSEfirewall2.service
 

2、开放端口

修改防火墙配置
vi /etc/sysconfig/SuSEfirewall2
在文件中找到FW_SERVICES_EXT_TCP,在其后面加上服务名或者是服务对应的端口
如果要开放多个端口则为 FW_SERVICES_EXT_TCP="22 80 8090"
 

3、放行VRRP协议 (用于keepalived搭建高可用规则)

vi /etc/sysconfig/SuSEfirewall2
将下面这行的注释去掉
FW_CUSTOMRULES="/etc/sysconfig/scripts/SuSEfirewall2-custom"
并将下面这行注释掉
FW_CUSTOMRULES=""
然后
vi /etc/sysconfig/scripts/SuSEfirewall2-custom
fw_custom_before_port_handling() {
# these rules will be loaded after the anti-spoofing and icmp handling
# and after the input has been redirected to the input_XXX and
# forward_XXX chains and some basic chain-specific anti-circumvention
# rules have been set,
# but before any IP protocol or TCP/UDP port allow/protection rules
# will be set.
# You can use this hook to allow/deny certain IP protocols or TCP/UDP
# ports before the SuSEfirewall2 generated rules are hit.
#添加下面这行
iptables -A INPUT -p vrrp -j ACCEPT -d 224.0.0.18
true
}
posted @   tonggc1668  阅读(1562)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 单元测试从入门到精通
历史上的今天:
2019-01-19 Kafka读取__consumer_offsets和Kafka 0.11客户端管理工具AdminClient
2019-01-19 kafkaconsumer SimpleExample
2019-01-19 test pom
2019-01-19 Windows10下设置Shift+右键增加cmd
点击右上角即可分享
微信分享提示