I currently have this snippet:
# flush all chains
iptables -F
iptables -t nat -F
iptables -t mangle -F
# delete all chains
iptables -X
Is there a possibility that some impervious rule will stay alive after running this?
The idea is to have a completely clean iptables config, that can be easily replaced by new ruleset (nevermind routes/ifconfig's parameters).
Best Answer
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
andFORWARD
chains toACCEPT
, as well:Clear ip6tables rules:
...and that should do it.
iptables -nvL
should produce this (or very similar) output: