版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/jiangxinquqi/article/details/79737642
防火墙基本操作指令
//查询防火墙状态:
[root@localhost ~]# service iptables status
//停止防火墙:
[root@localhost ~]# service iptables stop
//启动防火墙:
[root@localhost ~]# service iptables start
//重启防火墙:
[root@localhost ~]# service iptables restart
//永久关闭防火墙:
[root@localhost ~]# chkconfig iptables off
//永久关闭后启用:
[root@localhost ~]# chkconfig iptables on
开放端口
1.编辑 /etc/sysconfig/iptables
[root@localhost ~]# vim /etc/sysconfig/iptables
在尾行添加
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8084 -j ACCEPT
2.保存文件,终端执行重启防火墙
[root@localhost ~]# service iptables restart
3.查看防火墙状态
[root@localhost ~]# service iptables status