User-defined Actions


Prior to Shorewall version 1.4.9, rules in /etc/shorewall/rules were limited to those defined by Netfilter (ACCEPT, DROP, REJECT, etc.). Beginning with Shorewall version 1.4.9, users may use sequences of these elementary operations to define more complex actions.

To define a new action:
  1. Add a line to /etc/shorewall/actions that names your new action. Action names must be valid shell variable names as well as valid Netfilter chain names. It is recommended that the name you select for a new action begins with with a capital letter; that way, the name won't conflict with a Shorewall-defined chain name.
  2. Once you have defined your new action name (ActionName), then copy /etc/shorewall/action.template to /etc/shorewall/action.ActionName (for example, if your new action name is "Foo" then copy /etc/shorewall/action.template to /etc/shorewall/action.foo).
  3. Now modify the new file to define the new action.
Columns in the action.template file are as follows.

Example:

/etc/shorewall/actions:

LogAndAccept

/etc/shorewall/action.LogAndAccept

LOG:info
ACCEPT

Last Updated 12/09/2003 - Tom Eastep

Copyright © 2001, 2002, 2003 Thomas M. Eastep.