Linux查看防火墙状态

iptables基础知识

        service iptables status  查看防火墙状态

        service iptables stop  停止防火墙

        service iptables start  启动防火墙

        service iptables restart  重启防火墙

        chkconfig iptables off  永久关闭防火墙

        chkconfig iptables on  永久关闭后重启    

        开启80端口

        vim /etc/sysconfig/iptables

        -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

        保存退出后重启防火墙

        service iptables restart


firewall防火墙

            service firewalld start开启

            service firewalld restart 重启

            service firewalld stop 关闭

            firewall-cmd --list-all 查看防火墙规则

            firewall-cmd --query-port=8080/tcp 查询端口是否开放

            firewall-cmd --permanent --add-port=80/tcp 开放80端口

            firewall-cmd --permanent --remove-port=8080/tcp 移除端口

            firewall-cmd --reload重启防火墙(修改配置后要重启防火墙)


u=2373214653,4037861351&fm=26&gp=0.jpg







发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.5.2 Zero

WX:xcs345525801 QQ:345525801 Tel:19521445850 Email:xcssh868@163.com

Copyright © 2020 许承胜个人博客 版权所有 备案号:皖ICP备18014705号-1