Skip to content

Centos7 的防火墙功能完全失效[BUG] #2717

@SkiffBoy

Description

@SkiffBoy

联系方式

No response

1Panel 版本

v1.7.4

问题描述

防火墙列表中并未开放的端口,居然可以直接访问,这是防火墙功能失效了吗,防火墙的服务状态明明是启动的

image
  • 防火墙端口开放情况,防火墙并没有开放访问 phpAdmin 的 9212 端口
image
  • 从外部本机网络,测试 VPS 上的 9212 端口,是畅通的,27017 端口也是通的,都属于防火墙并未开放的端口
image * 浏览器可以访问 9212 端口 image
  • VPS 主机,进程管理界面的网络端口
image
  • VPS 主机,Docker 管理界面的端口映射情况
image

重现步骤

不知道什么原因导致的,总之执行过以下操作,应该是在某个执行过程中导致的问题

  1. 防火墙安装成功后,用过命令放行端口 22、80、443、8000 (1Panel端口)
firewall-cmd --zone=public --add-port=22/tcp --permanent
firewall-cmd --zone=public --add-port=8000/tcp --permanent
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
  1. VPS 界面执行过手动关机(并没有强制关机选项)
  2. 执行过 halt 命令(无任何参数)
  3. 在面板界面,执行过防火墙放行端口,防火墙阻止端口,删除防火墙规则
  4. 后续也在 VPS 界面执行过重启 VPS 主机操作

期待的正确结果

防火墙列表中并未开放的端口,无法从外部访问

No response

相关日志输出

systemctl status firewalld -l
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2023-10-29 03:55:37 CST; 8h ago
     Docs: man:firewalld(1)
 Main PID: 607 (firewalld)
    Tasks: 2
   Memory: 38.0M
   CGroup: /system.slice/firewalld.service
           └─607 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

Oct 29 03:55:48 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION-STAGE-1' failed: iptables: No chain/target/match by that name.
Oct 29 03:55:48 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION-STAGE-1' failed: iptables: No chain/target/match by that name.
Oct 29 03:55:48 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION-STAGE-2' failed: iptables: No chain/target/match by that name.
Oct 29 03:55:48 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION-STAGE-2' failed: iptables: No chain/target/match by that name.
Oct 29 03:55:48 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -F DOCKER-ISOLATION' failed: iptables: No chain/target/match by that name.
Oct 29 03:55:48 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -t filter -X DOCKER-ISOLATION' failed: iptables: No chain/target/match by that name.
Oct 29 03:55:48 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i br-07d9cd524661 -o br-07d9cd524661 -j DROP' failed: iptables: Bad rule (does a matching rule exist in that chain?).
Oct 29 03:55:48 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a matching rule exist in that chain?).
Oct 29 03:55:49 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i br-6e5a15b76da5 -o br-6e5a15b76da5 -j DROP' failed: iptables: Bad rule (does a matching rule exist in that chain?).
Oct 29 03:55:50 srv433366.hstgr.cloud firewalld[607]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w10 -D FORWARD -i docker0 -o docker0 -j DROP' failed: iptables: Bad rule (does a matching rule exist in that chain?).

附加信息

image

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions