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
相关推荐
AlfredZhao39 分钟前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334667 小时前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪8 小时前
linux 拷贝文件或目录到指定的位置
linux
大树881 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠1 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质1 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
bush41 天前
嵌入式linux学习记录十四、术语
linux·嵌入式
载数而行5201 天前
Linux 11 动态监控指令top
linux
Inhand陈工1 天前
基于台达PLC与映翰通IG502的智慧水产养殖精准投喂与远程运维解决方案
运维·人工智能·物联网·阿里云·信息与通信
酣大智1 天前
ARP代理--工作原理
运维·网络·arp·arp代理