wiki:save_iptables_rules_clear_firewall
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:save_iptables_rules_clear_firewall [2025/09/22 10:59] – [Save iptables rules and clear firewall] add important box antisa | wiki:save_iptables_rules_clear_firewall [2026/05/21 13:47] (current) – [See also] add iptables commands antisa | ||
|---|---|---|---|
| Line 30: | Line 30: | ||
| For IPv6 rules, substitute ip6tables instead of iptables. | For IPv6 rules, substitute ip6tables instead of iptables. | ||
| + | One-liner for **ipv4**: | ||
| + | |||
| + | iptables -P INPUT ACCEPT && iptables -P OUTPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X && iptables -t mangle -F && iptables -t mangle -X | ||
| + | |||
| + | One-liner for **ipv6**: | ||
| + | |||
| + | ip6tables -P INPUT ACCEPT && ip6tables -P OUTPUT ACCEPT && ip6tables -P FORWARD ACCEPT && ip6tables -F && ip6tables -X && ip6tables -t nat -F && ip6tables -t nat -X && ip6tables -t mangle -F && ip6tables -t mangle -X | ||
| + | |||
| + | One-liner all: | ||
| + | |||
| + | iptables -P INPUT ACCEPT && iptables -P OUTPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X && iptables -t mangle -F && iptables -t mangle -X && ip6tables -P INPUT ACCEPT && ip6tables -P OUTPUT ACCEPT && ip6tables -P FORWARD ACCEPT && ip6tables -F && ip6tables -X && ip6tables -t nat -F && ip6tables -t nat -X && ip6tables -t mangle -F && ip6tables -t mangle -X | ||
| + | |||
| After testing, you can re-enable your firewall rules by running the following: | After testing, you can re-enable your firewall rules by running the following: | ||
| Line 42: | Line 54: | ||
| ====== See also ====== | ====== See also ====== | ||
| + | * [[iptables_commands|iptables commands]] | ||
| ====== References ====== | ====== References ====== | ||
wiki/save_iptables_rules_clear_firewall.1758538776.txt.gz · Last modified: by antisa
