This program is a very simple manager for loading custom iptables rules. When the program is started, it will create a set of custom chains, to which all subsequent rules are added. When the program stops, it will flush and delete these custom chains.
The manager is written in Go and it can be downloaded and compiled using:
go get github.com/mrlhansen/iptables_manager
The program accepts three arguments. The start and stop options can be added at the same time, which will result in a reload of all rules.
Usage of iptables_manager:
-confdir string
path to the configuration directory (default "/etc/iptmgr")
-start
start the manager
-stop
stop the manager
When the program starts it will initialize a new set of chains using the rules in <confdir>/start.rules
and when it stops it will delete these chains by reading the rules in <confdir>/stop.rules
. Editing these two files might prevent the program from working properly, but they are kept as external files for flexibility. On startup, after initializing the new chains, it will proceed to read and apply the rules from all files in <confdir>/rules.d
in ordered sequence.