CentOS7 的防火墙配置跟以前版本有很大区别,CentOS7这个版本的防火墙默认使用的是firewall,与之前的版本使用iptables不一样
1、关闭防火墙:
systemctl stop firewalld.service
![技术分享图片](https://upload-images.jianshu.io/upload_images/6152595-e1a9925b99a69b53.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/481)
2、开启防火墙:
systemctl start firewalld.service
![技术分享图片](https://upload-images.jianshu.io/upload_images/6152595-520bc1c035bb4ff3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/482)
3、关闭开机启动:
systemctl disable firewalld.service
![技术分享图片](https://upload-images.jianshu.io/upload_images/6152595-5dc0df040e9814b8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/491)
4、开启开机启动:
systemctl enable firewalld.service
![技术分享图片](https://upload-images.jianshu.io/upload_images/6152595-dddf85ed2c6fc788.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/482)