Comments on: How to List and Delete iptables Firewall Rules https://www.rosehosting.com/blog/how-to-list-and-delete-iptables-firewall-rules/ Premium Linux Tutorials Since 2001 Mon, 05 Dec 2022 12:41:21 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: When you need to do a reset https://www.rosehosting.com/blog/how-to-list-and-delete-iptables-firewall-rules/#comment-46558 Sat, 20 Jan 2018 21:41:46 +0000 https://www.rosehosting.com/blog/?p=25269#comment-46558 Sometimes it is necessary to delete all rules and reset to wide open, temporarily …

——————-
for table in $(cat /proc/net/ip_tables_names | sort)
do
for action in F X Z
do
${IPTABLES} -t “${table}” “-${action}”
done
done

iptables -t filter -P INPUT ACCEPT
iptables -t filter -P FORWARD ACCEPT
iptables -t filter -P OUTPUT ACCEPT
—————–

And never forget that rules set for IPv4 with iptables are independent and separate from rules set for IPv6 with ip6tables. So if you have IPv6 connectivity you need to worry about setting up a firewall for that as well.

(The above article only concerns IPv4.)

]]>