当前位置:论坛首页 > Linux面板 > 求助

【待反馈】启用了系统防火墙导致面板和网网都无法访问...

发表在 Linux面板2021-1-13 14:13 [复制链接] 7 1941

一不小心点了系统防火墙,启用了系统防火墙导致面板和网站都无法访问了怎么办,
使用道具 举报 只看该作者 回复
发表于 2021-1-13 14:46:36 | 显示全部楼层
宝塔用户_wfueze 发表于 2021-1-13 14:31
现在网站能访问了,但面板访问不了

您好,ssh内执行下面命令后截图上来看看。

  1. firewall-cmd --list-all
  2. iptables -L -n
复制代码
使用道具 举报 回复 支持 1 反对 0
发表于 2021-1-13 14:31:34 | 显示全部楼层
现在网站能访问了,但面板访问不了
使用道具 举报 回复 支持 反对
发表于 2021-1-13 14:55:32 | 显示全部楼层

[root@VM-0-16-centos ~]# firewall-cmd --list-all
public
  target: default
  icmp-block-inversion: no
  interfaces:
  sources:
  services: dhcpv6-client ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
[root@VM-0-16-centos ~]# iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:443 state NEW
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
INPUT_direct  all  --  0.0.0.0/0            0.0.0.0/0
INPUT_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0
INPUT_ZONES  all  --  0.0.0.0/0            0.0.0.0/0
DROP       all  --  0.0.0.0/0            0.0.0.0/0            ctstate INVALID
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_direct  all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_IN_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_IN_ZONES  all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_OUT_ZONES_SOURCE  all  --  0.0.0.0/0            0.0.0.0/0
FORWARD_OUT_ZONES  all  --  0.0.0.0/0            0.0.0.0/0
DROP       all  --  0.0.0.0/0            0.0.0.0/0            ctstate INVALID
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
OUTPUT_direct  all  --  0.0.0.0/0            0.0.0.0/0

Chain FORWARD_IN_ZONES (1 references)
target     prot opt source               destination
FWDI_public  all  --  0.0.0.0/0            0.0.0.0/0           [goto]

Chain FORWARD_IN_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain FORWARD_OUT_ZONES (1 references)
target     prot opt source               destination
FWDO_public  all  --  0.0.0.0/0            0.0.0.0/0           [goto]

Chain FORWARD_OUT_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain FORWARD_direct (1 references)
target     prot opt source               destination

Chain FWDI_public (1 references)
target     prot opt source               destination
FWDI_public_log  all  --  0.0.0.0/0            0.0.0.0/0
FWDI_public_deny  all  --  0.0.0.0/0            0.0.0.0/0
FWDI_public_allow  all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0

Chain FWDI_public_allow (1 references)
target     prot opt source               destination

Chain FWDI_public_deny (1 references)
target     prot opt source               destination

Chain FWDI_public_log (1 references)
target     prot opt source               destination

Chain FWDO_public (1 references)
target     prot opt source               destination
FWDO_public_log  all  --  0.0.0.0/0            0.0.0.0/0
FWDO_public_deny  all  --  0.0.0.0/0            0.0.0.0/0
FWDO_public_allow  all  --  0.0.0.0/0            0.0.0.0/0

Chain FWDO_public_allow (1 references)
target     prot opt source               destination

Chain FWDO_public_deny (1 references)
target     prot opt source               destination

Chain FWDO_public_log (1 references)
target     prot opt source               destination

Chain INPUT_ZONES (1 references)
target     prot opt source               destination
IN_public  all  --  0.0.0.0/0            0.0.0.0/0           [goto]

Chain INPUT_ZONES_SOURCE (1 references)
target     prot opt source               destination

Chain INPUT_direct (1 references)
target     prot opt source               destination

Chain IN_public (1 references)
target     prot opt source               destination
IN_public_log  all  --  0.0.0.0/0            0.0.0.0/0
IN_public_deny  all  --  0.0.0.0/0            0.0.0.0/0
IN_public_allow  all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0

Chain IN_public_allow (1 references)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:22 ctstate NEW,UNTRACKED

Chain IN_public_deny (1 references)
target     prot opt source               destination

Chain IN_public_log (1 references)
target     prot opt source               destination

Chain OUTPUT_direct (1 references)
target     prot opt source               destination
是这个吗?
使用道具 举报 回复 支持 反对
发表于 2021-1-13 15:15:38 | 显示全部楼层
谢花郎 发表于 2021-1-13 14:46
您好,ssh内执行下面命令后截图上来看看。

应该是端口没开,刚刚放行一个443端口,请问这443端口开放正确码
如果面板端口也这样放行,可以吗,用的命令是
  1. iptables -I INPUT -p tcp --dport 443 -m state --state NEW -j ACCEPT
复制代码

为什么这些端口在面板里之前已经放行了,为什么开启系统防火墙后,放行端口全都没有呢?
使用道具 举报 回复 支持 反对
发表于 2021-1-13 16:23:01 | 显示全部楼层
宝塔用户_wfueze 发表于 2021-1-13 15:15
应该是端口没开,刚刚放行一个443端口,请问这443端口开放正确码
如果面板端口也这样放行,可以吗,用的 ...

是的,你firewalld内也需要添加一下端口的哦,iptables添加规则没错。
使用道具 举报 回复 支持 反对
发表于 2021-1-13 20:33:17 | 显示全部楼层
问题已解决,但有个问题我没搞懂,为什么云服务器面板端口放行了,宝塔面板端口已放行了,为什么开启系统防火墙,这些端口还要重新放行一遍,不通用
使用道具 举报 回复 支持 反对
发表于 2021-3-19 10:51:55 | 显示全部楼层
也遇到这个问题.
关键是怎么关闭系统防火墙这个坑货. 现在面板都登录不了了.
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理

工作时间:09:00至24:00

快速回复 返回顶部 返回列表