博客
关于我
Linux centos7 防火墙设置
阅读量:790 次
发布时间:2023-01-31

本文共 815 字,大约阅读时间需要 2 分钟。

防火墙管理指南

要对Linux系统中的防火墙进行有效管理,可以按照以下步骤操作:

  • 查看防火墙状态

    使用命令:systemctl list-unit-files | grep firewalld.servicesystemctl status firewalld.service 查看防火墙.service的状态。

  • 启用防火墙

    执行命令:systemctl start firewalld.service

  • 停止防火墙

    使用命令:systemctl stop firewalld.service

  • 重启防火墙

    áním命令:systemctl restart firewalld.service

  • 设置开机启动

    执行命令:systemctl enable firewalld.service

  • 禁用开机启动

    使用命令:systemctl disable firewalld.service

  • 查看开机自启状态

    输入命令:systemctl is-enabled firewalld.service; echo $? 查看是否为开机自启状态。

  • 列出所有开机自启服务

    输入命令:systemctl list-unit-files | grep enabled 查看所有开机自启服务。

  • 查看已开放的端口

    输入命令:firewall-cmd --list-ports 查看已开放的端口。

  • 添加新端口

    使用命令:firewall-cmd --zone=public --add-port=80/tcp --permanent 添加TCP协议的80端口,--permanent 表示持久生效。

  • 重启防火墙

    执行命令:firewall-cmd --reload 实际应用中需谨慎操作。

  • 查看防火墙运行状态

    输入命令:firewall-cmd --state 查看防火墙的运行状态。

  • 记住,只有在确认所在网络环境的安全需求后,才建议开放或添加新的端口。

    转载地址:http://efwfk.baihongyu.com/

    你可能感兴趣的文章
    leaflet实现wms服务面要素可点击(leaflet篇.30)
    查看>>
    leaflet接入geoserver发布的热力图服务(leaflet篇.29)
    查看>>
    leaflet接入土地资源(leaflet篇.55)
    查看>>
    leaflet接入天地图(经纬度投影256)(leaflet篇.24)
    查看>>
    leaflet点采集与点编辑(leaflet篇.5)
    查看>>
    leaflet自定义地图样式地图(插件实现)(leaflet篇.18)
    查看>>
    leaflet蜂巢图(leaflet篇.15)
    查看>>
    leaflet轨迹线(leaflet篇.58)
    查看>>
    leaflet面采集与面编辑(leaflet篇.7)
    查看>>
    leaflet饼状图(leaflet篇.74)
    查看>>
    LeakCanary使用,案例静态Toast引起的内存泄漏
    查看>>
    Leapin' Lizards
    查看>>
    learn c++(vector and array)
    查看>>
    Learning both Weights and Connections for Efficient Neural Networks
    查看>>
    Leedcode3- Max Points on a Line 共线点个数
    查看>>
    LeetCode OJ:Merge k Sorted Lists(归并k个链表)
    查看>>
    leetcode Plus One
    查看>>
    LeetCode shell 题解(全)
    查看>>
    LeetCode Text Justification
    查看>>
    leetcode Valid Parentheses
    查看>>