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.

 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2018-01-02.   This site is PIKT® powered.
Copyright © 1998-2018 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
reset iptables
script config file