Centos 7.2 配置防火墙
2016-05-07 19:26
567 查看
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运维学习决心书
- Linux进程与线程的区别
- IO复用之select poll epoll的总结
- 虚拟机+CentOS内核hack7、8、9、17失败记
- linux设备驱动编程环境的搭建小结(结合LDD3使用)
- 转载 - LINUX下查看CPU使用率的命令
- 用extundelete恢复误删除数据实战
- linux守护进程
- Linux:信号(上)
- 块设备驱动程序(Linux设备驱动程序)
- Linux basic knowledge
- 整理
- 在windows10上安装debian8.4无法启动
- Linux添加FTP用户并设置权限
- linux 磁盘分区挂载
- Linux CentOs6.5 vim 常用按键
- linux下如何更改capslock键为ESC
- linux系统被入侵后处理经历
- Linux下high CPU分析心得【非原创】
- 解决 U盘安装Centos后拔除U盘无法启动问题方法,重新建立引导分区