Oracle Cloud 删除防火墙

时间:2020-05-06 14:49:35   收藏:0   阅读:227

Oracle Cloud 的ubuntu 镜像预置了iptables规则,即使你设置了安全组,子网,放通所有地址和端口,依然不能用。这里是一个粗暴的方法,删除了预置规则,关闭了Oracle 的初始化服务, 脚本内容:

#! /bin/bash

# Note: Run as root

# 清空 iptables
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F

# 持久化 iptables,不需要删除 iptables包
netfilter-persistent save


# 停止 oracle 服务, 通过 systemctl --type=service 查看 cloud init 服务
 
systemctl disable cloud-config.service                               
systemctl disable cloud-final.service
systemctl disable cloud-init-local.service                               
systemctl disable cloud-init.service

# 重启 systemctl
systemctl daemon-reload

# 最后重启系统
shutdown -r

原文:https://www.cnblogs.com/gardenofhu/p/12835758.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!