Linux防火墙相关命令(开启防火墙、关闭防火墙、添加ip白名单等)

  1. 查看防火状态

    java 复制代码
    systemctl status firewalld
    service  iptables status
  2. 暂时关闭防火墙

    java 复制代码
    systemctl stop firewalld
    service  iptables stop
  3. 永久关闭防火墙

    java 复制代码
    systemctl disable firewalld
    chkconfig iptables off
  4. 启动防火墙

    java 复制代码
    systemctl start firewalld
  5. 重启防火墙

    java 复制代码
    systemctl enable firewalld
    service iptables restart  
  6. 设置开机启动

    java 复制代码
    systemctl enable firewalld
  7. 停止并禁用开机启动

    java 复制代码
    sytemctl disable firewalld
  8. 在指定区域打开端口(记得重启防火墙)

    java 复制代码
    firewall-cmd --zone=public --add-port=80/tcp

    永久生效再加上 --permanent

    java 复制代码
    firewall-cmd --zone=public --add-port=5060-5059/udp --permanent
相关推荐
C_心欲无痕1 小时前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜6002 小时前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston3 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng20183 小时前
Linux下Beyond Compare过期
linux·运维·服务器
喵叔哟3 小时前
20.部署与运维
运维·docker·容器·.net
HIT_Weston3 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式3 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
码农小韩5 小时前
基于Linux的C++学习——指针
linux·开发语言·c++·学习·算法
wdfk_prog5 小时前
[Linux]学习笔记系列 -- [fs]seq_file
linux·笔记·学习
Jay Chou why did6 小时前
wsl安装完无法进入wsl
linux