Centos7 关闭防火墙,过滤端口
2016-07-30 09:24
417 查看
本文转自:http://www.cnblogs.com/silent2012/archive/2015/07/28/4682770.html,未作修改。
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 #设置防火墙开机启动
最后重启系统使设置生效即可。
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 #设置防火墙开机启动
最后重启系统使设置生效即可。
相关文章推荐
- 过滤淘宝网弹出窗口
- 端口详解(3)-源端口
- Vista 防火墙 Vista Firewall Control v1.0.11 下载
- 常见路由器关闭端口
- 收集的ROS防火墙脚本
- C#实现简单过滤非法字符实例
- dedecms采集过滤常用代码集合
- AutoRun病毒专杀防火墙 V4.39 绿色版
- C#敏感词过滤实现方法
- C#端口转发用法详解
- 使用位运算实现网页中的过滤、筛选功能实例
- Windows Powershell过滤管道结果
- C#检测远程计算机端口是否打开的方法
- C#实现过滤sql特殊字符的方法集合
- php下过滤HTML代码的函数
- C#检测是否有危险字符的SQL字符串过滤方法
- vbs更改3389远程桌面端口的脚本
- asp 过滤非法字符函数
- asp.net MVC利用ActionFilterAttribute过滤关键字的方法
- jQuery内容过滤选择器用法分析