首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

工作总结之linux防火墙配置命令适用centos7、centos8

在Linux防火墙配置中,我们可以使用以下命令:

  • 开启防火墙:systemctl start firewalld
  • 关闭防火墙:systemctl stop firewalld
  • 查看防火墙状态:systemctl status firewalld
  • 开启防火IP规则:firewall-cmd --permanent --add-service=http
  • 关闭防火IP规则:firewall-cmd --permanent --remove-service=http
  • 查看防火IP规则:firewall-cmd --permanent --list-services
  • 管理防火UDP规则:firewall-cmd --permanent --add-port=8080/udp
  • 删除防火UDP规则:firewall-cmd --permanent --remove-port=8080/udp
  • 查看防火UDP规则:firewall-cmd --permanent --list-ports
  • 管理防火ICMP规则:firewall-cmd --permanent --add-rule icmp-host-unreachable
  • 删除防火ICMP规则:firewall-cmd --permanent --remove-rule icmp-host-unreachable

以上命令适用于CentOS 7和CentOS 8版本。在配置防火墙时,请注意添加或删除指定的规则来允许或拒绝特定服务和端口。这些规则需要使用--permanent参数来保证永久生效,在重启后仍保持设置。

页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

15分15秒

026_尚硅谷课程系列之Linux_基础篇_系统管理(三)_配置服务开机启动和关闭防火墙

15分15秒

026_尚硅谷课程系列之Linux_基础篇_系统管理(三)_配置服务开机启动和关闭防火墙

领券