Skip to content

Instantly share code, notes, and snippets.

@dyllanwli
Created June 4, 2020 15:09
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 dyllanwli/955ef8f0108c374ef5aa465044f51969 to your computer and use it in GitHub Desktop.
Save dyllanwli/955ef8f0108c374ef5aa465044f51969 to your computer and use it in GitHub Desktop.
Reset your iptables
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
# https://serverfault.com/questions/200635/best-way-to-clear-all-iptables-rules
# To answer your question succinctly, no: there would not be any "leftover" rules after flushing every table. In the interest of being thorough however, you may want to set the policy for the built-in INPUT and FORWARD chains to ACCEPT, as well
iptables -P OUTPUT ACCEPT
iptables -t nat -F
iptables -t mangle -F
iptables -F
iptables -X
ip6tables -P INPUT ACCEPT
ip6tables -P FORWARD ACCEPT
ip6tables -P OUTPUT ACCEPT
ip6tables -t nat -F
ip6tables -t mangle -F
ip6tables -F
ip6tables -X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment