zoukankan      html  css  js  c++  java
  • Linux防火墙 firewall-cmd

    开启防火墙

    systemctl start firewalld.service

    防火墙开机启动

    systemctl enable firewalld.service

    关闭防火墙

    systemctl stop firewalld.service

    查看防火墙状态

    firewall-cmd --state

    查看防火墙规则

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

    开放端口

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

    开放多端口

    firewall-cmd --permanent --zone=public --add-port=8080-8083/tcp

    开放IP端口

    firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="6379" accept"
    firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.0.233" accept"

    开放IP段端口

    firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.0.0/16" accept"
    firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.1.0/24" port protocol="tcp" port="9200" accept"

    删除端口

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

    删除IP端口

    firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="192.168.1.51" accept"

    重载防火墙

    firewall-cmd --reload
  • 相关阅读:
    string subscript out of range
    基数树(radix tree)
    改进版的快速排序
    快速排序算法-C语言实现
    归并排序
    用数组名做函数参数(转)
    堆和栈的区别
    给指针malloc分配空间后就等于数组吗?
    codeblocks中添加-std=c99
    堆排序-C语言实现
  • 原文地址:https://www.cnblogs.com/xuanjiange/p/15471829.html
Copyright © 2011-2022 走看看