Skip to content

Instantly share code, notes, and snippets.

@karolsteve
Forked from SanjaySRocks/flush-oracle.sh
Created March 16, 2025 17:51
Show Gist options
  • Save karolsteve/b2a1256fdcfd496c48f39dfa717b49b7 to your computer and use it in GitHub Desktop.
Save karolsteve/b2a1256fdcfd496c48f39dfa717b49b7 to your computer and use it in GitHub Desktop.
Remove all default firewall rules in oracle cloud permanently
# Take backup of iptables
cp /etc/iptables/rules.v4 /etc/iptables/rules.v4.backup
cp /etc/iptables/rules.v6 /etc/iptables/rules.v6.backup
# Flush rules
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Save changes
iptables-save > /etc/iptables/rules.v4
ip6tables-save > /etc/iptables/rules.v6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment