Reset Iptables
reset_iptables_programs.cfg specifies a simple program to reset iptables--clear the existing firewall rules. Note how the #include directive incorporates the iptables_reset_programs.cfg file, allowing us to reuse the same source code in both the iptables reset script and the iptables firewall program.
/////////////////////////////////////////////////////////////////////////////// // // firewall_programs.cfg - programs to specify and help administer // the iptables firewall // /////////////////////////////////////////////////////////////////////////////// #if firewall /////////////////////////////////////////////////////////////////////////////// [... other programs omitted ...] /////////////////////////////////////////////////////////////////////////////// reset_iptables #!/bin/bash #ifdef debug set -x #endifdef #include <programs/adm/iptables_reset_programs.cfg> /////////////////////////////////////////////////////////////////////////////// [... other programs omitted ...] /////////////////////////////////////////////////////////////////////////////// #endif // firewall ///////////////////////////////////////////////////////////////////////////////
On the piktmaster system, we would install the standalone reset_iptables script to each slave firewall system with the command:
# piktc -iv +P reset_iptables +H firewall
For more examples, see Samples.