Linux下持续集成环境之防火墙设置

Linux下持续集成环境之防火墙设置(centos7)

文章来源:https://blog.csdn.net/omsvip/article/details/80295647


firewall操作

1、查看防火墙状态:firewall-cmd –state
2、关闭防火墙:systemctl stop firewalld.service
3、开启防火墙:systemctl start firewalld.service
4、禁止开机启动启动防火墙:systemctl disable firewalld.service

iptables操作

1、安装:yum install iptables-services
2、开启iptables防火墙:systemctl start iptables.service
3、关闭iptables防火墙:systemctl stop iptables.service
4、查看iptables防火墙状态:systemctl status iptables.service

配置iptables

vi /etc/sysconfig/iptables

添加端口

-A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 3306 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 8080 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 9090 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 9091-j ACCEPT

重启iptables

systemctl restart iptables.service

开机启动iptables

systemctl enable iptables.service

文章来源:

上篇文章地址:https://blog.csdn.net/omsvip/article/details/80295338

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值