Linux 防火墙

CentOS7默认的防火墙不是iptables,而是firewalle. 

禁用/停止自带的firewalld服务

#停止firewalld服务
systemctl stop firewalld
#禁用firewalld服务
systemctl mask firewalld

CentOS7安装iptables防火墙

#先检查是否安装了iptables
service iptables status
#安装iptables
yum install -y iptables
#升级iptables
yum update iptables 
#安装iptables-services
yum install iptables-services

Linux下iptables禁用和开放端口

https://www.cnblogs.com/zongfa/p/7967935.html

iptables设置ping协议ICMP

iptables -t filter -A INPUT -p icmp --icmp-type 0 -j ACCEPT  #允许请求进来
iptables -t filter -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT  #允许响应出去

执行完上述的命令之后,可在另外一台主机上实现对本机的ping测试
type 8为ping 命令请求信号
type 0为ping 命令响应信号 

【转】防火墙的基础知识

【转】iptables、firewall开启端口教程

【转】centos7启动iptables时报Job for iptables.service failed because the control process exited with error cod

 

iptales -F           #清空防火墙规则

/etc/init.d/iptables save   #保存

service iptables stop      #关闭防火墙

chkconfig iptables off

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值