您的位置:首页 > 运维架构 > Linux

Centos7 防火墙配置

2015-09-22 00:00 363 查看
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。

### 关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

### 安装iptables防火墙
yum install iptables-services #安装
vi /etc/sysconfig/iptables #编辑防火墙配置文件

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT  #加入80端口
:wq! #保存退出

###最后重启防火墙使配置生效
systemctl restart iptables.service
###设置防火墙开机启动
systemctl enable iptables.service
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Centos7 iptables