########################firewall###################
1.
火墙的安装与启用
    yum install firewalld firewall-config-y
    systemctl start firewalld
    systemctl enable firewalld

2.
命令及一些操作:
    firewall-cmd --state    ##查看firewalld的状态
    firewall-cmd --get-active-zones ##查看当前活动的区域,附带接口列表
    firewall-cmd --get-default-zone ##查看默认区域
    firewall-cmd --zone=public --list-all==列出指定区域的所有设置
    firewall-cmd --get-services ==列出所有预设服务
linux运维-firewall

linux运维-firewall    firewall-cmd --list-all-zones   ##列出所有区域的设置

linux运维-firewall

linux运维-firewall


linux运维-firewall   

 firewall-cmd --list-all     ##列出默认区域的设置
    firewall-cmd --set-default-zone=trusted ##设置默认区域
    firewall-cmd --permanent--zone=trusted -add-source=172.25.254.122/24   ##设置网络地址到指定区域
    firewall-cmd --permanent--zone=trusted -remove-source=172.25.254.122/24 ##删除指定区域中的网络地址
linux运维-firewall

linux运维-firewall    接口的添加与删除:

    firewall-cmd --permanent --zone=public--remove-interface=eth1 ##删除网络接口
    firewall-cmd --permanent --zone=public--add-interface=eth1 ##添加网络接口
    firewall-cmd --permanent --zone=public--change-interface=eth1 ##修改网络接口
linux运维-firewall
    服务的添加与删除:

    firewall-cmd --permanent --zone=public--add-service=smtp ##添加服务
    firewall-cmd --reload   ##重载防火墙
linux运维-firewall
    端口的添加与删除:

    firewall-cmd --zone=public--list-ports ##列出端口
    firewall-cmd --permanent--add-port=8080/tcp ##删除端口
linux运维-firewall
 

相关文章:

  • 2021-05-06
  • 2021-11-22
  • 2021-04-13
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-06-21
猜你喜欢
  • 2021-09-29
  • 2022-01-06
  • 2022-01-13
  • 2021-12-13
  • 2021-07-04
  • 2022-12-23
相关资源
相似解决方案