全球主机交流论坛

标题: 关于 Orcale cloud centos8 的 iptables [打印本页]

作者: yanqing001    时间: 2021-12-23 21:52
标题: 关于 Orcale cloud centos8 的 iptables
Oracle 的 centos8 镜像默认同时带了 firewall 跟 iptables 并且在 iptables 里面带了很多规则,导致大多数端口都被禁止

通过  sudo iptables –F 命令可以 开发所有端口

但是每次重启后它又会恢复

讨厌的是 Oracle 家的镜像不同于其他的 CentOS

service 里面没有  iptables 的服务
没办法通过 下面命令禁止

systemctl stop firewalld.service
systemctl disable firewalld.service

我也找不到 持久化修改后的 iptables 的办法

请教各位大佬,怎么解决这个问题的?
作者: optimism    时间: 2021-12-23 21:55
卸载了就行
作者: Laden    时间: 2021-12-23 21:58
提示: 作者被禁止或删除 内容自动屏蔽
作者: hostvac    时间: 2021-12-23 22:02
optimism 发表于 2021-12-23 21:55
卸载了就行

这机器人挺智能啊,封了可惜
作者: telnetpig    时间: 2021-12-23 22:03
iptables -F 清空防火墙

修改完规则后,将规则保存到文件,位置根据需要可以改

iptables-save > /root/iptables.conf
开机自动恢复,在/etc/rc.d/rc.local添加
iptables-restore < /root/iptables.conf



作者: hostvac    时间: 2021-12-23 22:03
你没保存,最后输这个

service iptables save
作者: yanqing001    时间: 2021-12-23 22:53
hostvac 发表于 2021-12-23 22:03
你没保存,最后输这个

service iptables save

你没看明白我的问题
-------------------------------
没有 iptables 这个服务
我也不知道 oracle 怎么魔改的系统

[root@okx2 ~]# service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
[root@okx2 ~]# service iptables reload
Redirecting to /bin/systemctl reload iptables.service
Failed to reload iptables.service: Unit iptables.service not found.

作者: yanqing001    时间: 2021-12-23 22:58
telnetpig 发表于 2021-12-23 22:03
iptables -F 清空防火墙

修改完规则后,将规则保存到文件,位置根据需要可以改

这方法没用,重启后 它会把自己默认的规则写进去 !
作者: meta    时间: 2021-12-23 22:59
直接 dd 新系统,一了百了
作者: hostvac    时间: 2021-12-23 22:59
yanqing001 发表于 2021-12-23 22:53
你没看明白我的问题
-------------------------------
没有 iptables 这个服务

我也用的Oracle Linux,没问题
作者: yunyouu    时间: 2021-12-23 23:00
iptables 有个默认配置文件夹,开机会固定加载。改个名或者删了就行
作者: yanqing001    时间: 2021-12-23 23:07
hostvac 发表于 2021-12-23 22:59
我也用的Oracle Linux,没问题

我是 oracle cloud 的 centos8
作者: yanqing001    时间: 2021-12-23 23:08
yunyouu 发表于 2021-12-23 23:00
iptables 有个默认配置文件夹,开机会固定加载。改个名或者删了就行

在哪里,我找半天没找到
作者: yunyouu    时间: 2021-12-23 23:14
yanqing001 发表于 2021-12-23 23:08
在哪里,我找半天没找到

/etc/sysconfig/iptables 看看,其他就不知道了
作者: yanqing001    时间: 2021-12-23 23:15
yunyouu 发表于 2021-12-23 23:14
/etc/sysconfig/iptables 看看,其他就不知道了

ls /etc/sysconfig/iptables
ls: cannot access '/etc/sysconfig/iptables': No such file or directory

-----------------------------------------------------------
系统被 Oracle 魔改了
作者: 三氧化二砷    时间: 2021-12-23 23:21
yum remove iptables -y?
作者: yanqing001    时间: 2021-12-24 13:57
三氧化二砷 发表于 2021-12-23 23:21
yum remove iptables -y?

不删不行吗?
删了可能会影响其他系统
作者: vlin    时间: 2021-12-24 13:59
dd 新系统吧
作者: bgh2001    时间: 2021-12-24 14:05
停用firewalld,然后启用iptables

systemctl stop firewalld
systemctl disable firewalld
yum -y install iptables iptables-serivce
systemctl enable iptables
systemctl start iptables




作者: yunyouu    时间: 2021-12-24 14:48
对了,突然想到 centos8 用 nftables 替换了 iptables。看下这个目录 /etc/nftables.conf
作者: yanqing001    时间: 2021-12-24 14:58
yunyouu 发表于 2021-12-24 14:48
对了,突然想到 centos8 用 nftables 替换了 iptables。看下这个目录 /etc/nftables.conf ...

ls /etc/nftables.conf
ls: cannot access '/etc/nftables.conf': No such file or directory


作者: yunyouu    时间: 2021-12-24 15:01
yanqing001 发表于 2021-12-24 14:58
ls /etc/nftables.conf
ls: cannot access '/etc/nftables.conf': No such file or directory

害,我去搞个乌龟壳研究研究。
作者: CMBCHINA    时间: 2021-12-24 15:03
RED HAT 7+都是firewalld去操作iptable的,你把firewalld关了iptable也就没用了,




欢迎光临 全球主机交流论坛 (https://443502.xyz/) Powered by Discuz! X3.4