Skip to content

Instantly share code, notes, and snippets.

@selivan
Created March 10, 2024 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selivan/ea8b486fd25474e41b83410744072cac to your computer and use it in GitHub Desktop.
Save selivan/ea8b486fd25474e41b83410744072cac to your computer and use it in GitHub Desktop.
#!/bin/sh
# Accept all traffic first to avoid ssh lockdown via iptables firewall rules #
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Flush All Iptables Chains/Firewall rules #
iptables -F
# Delete all Iptables Chains #
iptables -X
# Flush all counters too #
iptables -Z
# Flush and delete all nat and mangle #
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -t raw -F
iptables -t raw -X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment