zoukankan      html  css  js  c++  java
  • centos之iptables与firewalld

      1、iptables

      1)查看是否安装iptables

    rpm -qa | grep iptables

      2)查看是否启动iptables

    systemctl status iptables.service

      3)启动iptables

    systemctl start iptables.service

      4)临时禁用一个端口,禁掉8002端口,无需重启iptables

    iptables -I INPUT -p tcp --dport 8002 -j DROP

      清掉临时规则,执行完这一句8002端口又能访问了,无需重启iptables

    iptables -F

      2、firewall

      1)查看firewall状态:

    systemctl status firewalld

      2)关闭firewall:

    systemctl stop firewalld

      3)开启firewall:

    systemctl start firewalld

      4)开放端口

    firewall-cmd --zone=public --add-port=5672/tcp --permanent

      5)关闭端口

    firewall-cmd --zone=public --remove-port=5672/tcp --permanent

      6)使设置立即生效

    firewall-cmd --reload

      7)查看所有开放的端口

    firewall-cmd --zone=public --list-ports

      8)查看某端口是否开启

    firewall-cmd --query-port=5672/tcp
  • 相关阅读:
    所有时间测试函数
    时间函数应用 time
    50个c/c++源代码网站
    ASN.1详解
    SNMP协议
    SNMP协议详解
    大数据需要建立规则和标准
    常用的三层架构设计
    构建大型网站架构十步骤
    iOS 应用程序内部国际化,不跟随系统语言
  • 原文地址:https://www.cnblogs.com/javasl/p/12877645.html
Copyright © 2011-2022 走看看