BH7DAO

  • 首页
  • 文章归档
  • 快乐成长
  • IT技术
  • 业余无线电
  • 垂钓
  • 旅游出行
  • CW在线练习
  • 关于

  • 搜索
防火墙 CentOS T2CS APRS redis Mybatis 消息队列 libcurl oauth2 Nginx Markdown Springboot Spring Gateway同时支持https与http

CentOS7防火墙配置

发表于 2023-11-17 | 分类于 IT技术 | 0 | 阅读次数 1615

a. 常用命令详解
以下是一些常用的防火墙命令及其作用:

检查防火墙状态

systemctl status firewalld # 检查 firewalld 服务状态
firewall-cmd --state # 检查防火墙是否启用

开启/关闭防火墙

systemctl start firewalld # 启动防火墙
systemctl stop firewalld # 停止防火墙
systemctl restart firewalld # 重启防火墙
systemctl enable firewalld # 开机自启动防火墙
systemctl disable firewalld # 禁止开机自启动防火墙

添加端口

firewall-cmd --zone=public --add-port=80/tcp --permanent # 打开80端口,添加永久规则
firewall-cmd --zone=public --remove-port=80/tcp --permanent # 关闭80端口,移除永久规则

添加服务

firewall-cmd --zone=public --add-service=http --permanent # 打开http服务,添加永久规则
firewall-cmd --zone=public --remove-service=http --permanent # 关闭http服务,移除永久规则

b. 各种命令的区别与重要性
iptables:传统的 Linux 防火墙工具,使用较为复杂。
firewall-cmd:CentOS7 引入的新的防火墙工具,简单易用,建议使用。
firewalld:CentOS7 默认使用的防火墙服务,基于 firewall-cmd 实现。

您的支持是前进的动力 :)
louis 微信支付

微信支付

louis 支付宝

支付宝

  • 本文作者: louis
  • 本文链接: http://www.plsql.cc/archives/centos7-fang-huo-qiang-pei-zhi
  • 版权声明: 本博客所有文章除特别声明外,均采用xxm 许可协议。转载请注明出处!
# CentOS # 防火墙
登录Linux系统的时候会提示:“您在 /var/spool/mail/root 中有邮件”的解决办法
  • 文章目录
  • 站点概览
louis

louis

17 日志
5 分类
13 标签
RSS
E-mail
Creative Commons
© 2019 — 2025 XXM
湘ICP备15018446号-1