全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1185|回复: 3

[疑问] 甲骨文的的默认防火墙规则真睿智

[复制链接]
发表于 2021-8-17 15:33:29 | 显示全部楼层 |阅读模式
系统镜像:CentOS 8

遇到问题:控制台安全组已经完全放行。CentOS内部使用firewall-cmd放行80端口,但是始终无法连接;停用firewalld之后,可以连接。

使用iptables命令排查,发现系统中有很多莫名其妙的规则
  1. Chain BareMetalInstanceServices (1 references)
  2. target     prot opt source               destination
  3. ACCEPT     tcp  --  0.0.0.0/0            169.254.0.2          owner UID match 0 tcp dpt:3260 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  4. ACCEPT     tcp  --  0.0.0.0/0            169.254.2.0/24       owner UID match 0 tcp dpt:3260 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  5. ACCEPT     tcp  --  0.0.0.0/0            169.254.4.0/24       owner UID match 0 tcp dpt:3260 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  6. ACCEPT     tcp  --  0.0.0.0/0            169.254.5.0/24       owner UID match 0 tcp dpt:3260 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  7. ACCEPT     tcp  --  0.0.0.0/0            169.254.0.2          tcp dpt:80 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  8. ACCEPT     udp  --  0.0.0.0/0            169.254.169.254      udp dpt:53 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation
  9. ………………………………………………………………
复制代码


也就是说甲骨文通过某种方式插入很多自定义防火墙规则,结果破坏了firewalld的规则,导致外部访问失败。

经过检查systemd日志,在firewalld的日志中发现了大量插入语句,最后发现甲骨文的规则隐藏在/etc/firewalld/direct.xml


解决方法: 删掉 /etc/firewalld/direct.xml
 楼主| 发表于 2021-8-17 15:34:32 | 显示全部楼层
也不知道是不是甲骨文为了推自家的Oracle Linux故意使坏,浪费了我整整两个小时
发表于 2021-8-17 15:36:20 | 显示全部楼层
了解了  感谢踩坑 但是可以选Ubuntu
 楼主| 发表于 2021-8-17 15:37:27 | 显示全部楼层
Dwight 发表于 2021-8-17 15:36
了解了  感谢踩坑 但是可以选Ubuntu

要用SELinux,只有红帽的系统支持
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-1 18:14 , Processed in 0.060414 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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