CentOS7防火墙
2015-08-16 15:11
531 查看
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。启用iptables防火墙
1、关闭firewall
停止firewall
# systemctl stop firewalld.service
禁止firewall开机启动
# systemctl disable firewalld.service
或者
# systemctl mask firewalld.service
2、使用iptables和ip6tables的静态防火墙规则
如果你想使用自己的 iptables 和 ip6tables 静态防火墙规则, 那么请安装 iptables-services 并且禁用 firewalld ,启用 iptables 和ip6tables:
安装iptables防火墙
# yum install iptables-services
编辑防火墙配置文件
# vi /etc/sysconfig/iptables
静态防火墙规则配置文件是 /etc/sysconfig/iptables 以及 /etc/sysconfig/ip6tables .
设置防火墙开机启动
# systemctl enable iptables.service
# systemctl enable ip6tables.service
最后重启防火墙使配置生效
# systemctl restart iptables.service
参考:
http://www.open-open.com/lib/view/open1411818940031.html
http://www.centoscn.com/CentOS/Intermediate/2015/0313/4879.html
1、关闭firewall
停止firewall
# systemctl stop firewalld.service
禁止firewall开机启动
# systemctl disable firewalld.service
或者
# systemctl mask firewalld.service
2、使用iptables和ip6tables的静态防火墙规则
如果你想使用自己的 iptables 和 ip6tables 静态防火墙规则, 那么请安装 iptables-services 并且禁用 firewalld ,启用 iptables 和ip6tables:
安装iptables防火墙
# yum install iptables-services
编辑防火墙配置文件
# vi /etc/sysconfig/iptables
静态防火墙规则配置文件是 /etc/sysconfig/iptables 以及 /etc/sysconfig/ip6tables .
设置防火墙开机启动
# systemctl enable iptables.service
# systemctl enable ip6tables.service
最后重启防火墙使配置生效
# systemctl restart iptables.service
参考:
http://www.open-open.com/lib/view/open1411818940031.html
http://www.centoscn.com/CentOS/Intermediate/2015/0313/4879.html
相关文章推荐
- Linux文件系统管理-常用命令df\du\fsck\dumpe2fs
- Linux下权限管理-文件系统属性权限chattr/sudo
- linux 下安装ssh
- linux下配置phpInterperter
- Linux下权限管理-文件特殊权限setUID/sticky BIT
- linux学习之路(3)
- linux设置默认启动的服务 NFS VSFTPD
- linux下安装phpstorm
- centos 7 图形界面 文本界面切换
- centos7 配置vim编辑器
- linux常见类库及简单介绍
- linux学习之路(2)
- 把握linux内核设计思想(十三):内存管理之进程地址空间
- linux基础命令(更新中......)
- [Linux]curl输出原始数据,不对网页解压
- linux学习之路(1)
- CentOS yum 源的配置与使用
- linux下启动xampp
- 每天一个Linux命令-19(which,whereis,locate,find区别)
- Linux下安装java运行环境