centos防火墙关闭
2016-06-14 19:09
543 查看
CentOS 7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下
1、直接关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、设置 iptables service
yum -y install iptables-services
如果要修改防火墙配置,如增加防火墙端口3306
vi /etc/sysconfig/iptables
增加规则
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
保存退出后
systemctl restart iptables.service #重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
最后重启系统使设置生效即可。
1、直接关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
2、设置 iptables service
yum -y install iptables-services
如果要修改防火墙配置,如增加防火墙端口3306
vi /etc/sysconfig/iptables
增加规则
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
保存退出后
systemctl restart iptables.service #重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
最后重启系统使设置生效即可。
相关文章推荐
- linux历史——正在更新中
- 一座逝去的里程碑VxWorks2Linux
- CentOS7安装EPEL源
- Linux下使用laravel5.2
- linux top命令显示参数详解
- Linux中表示“时间”的结构体和相关函数
- Linux历史上线程的3种实现模型
- Linux磁盘分区(一):添加
- Linux下MakeFile初探
- Android下led控制(中)--Linux部分
- Linux(kubuntu)下面使用Thunderbird连接Exchange邮件服务器
- linux 目录
- akira之修改linux 4.6.2内核并添加系统调用
- linux环境变量设置方法总结(PATH/LD_LIBRARY_PATH)
- linux--几种常见的进程调度算法
- Linux资源监控工具
- Linux用户和权限管理
- Linux基本命令之find命令详解
- linux下查看硬盘型号、大小等信息(含Raid)
- Linux下配置php运行环境