在CentOS 7.x中使用iptables防火墙
1、在操作之前,先介绍下在本文会使用到几个命令查看指定服务的状态:systemctl 衡痕贤伎status [service_name]开始指定服务:systemctl start[service_name]停用指定服务:systemctl stop[service_name]启用指定服务:systemctl enable[service_name]禁用指定服务:systemctl disable[service_name]
2、打开“终端”,因为作为开发学习用的机子,默认的图形界面

3、在“终端”中切换到root帐号# su root否则,在接下去的操作中会不停的提示你输入root帐号密码

4、停用firewalld# systemctl stop firewalld禁止开机启动firewalld# systemctl disable firewalld再查看下firewalld的信息# systemctl status firewalld

5、CentOS 7.x默认是不安装ipta水瑞侮瑜bles,所以我们先安装iptables查看iptables的傻疑煜阖信息# systemctl status iptables安装iptables# yum install iptables再安装iptables-services# yum install iptables-servicesPS:如果你想安装过程不用干涉,则可使用以下命令:# yum install -y iptables# yum install -y iptables-services


6、这样完成iptables防火墙的安装了