Alfandega 0.4-x - Documentation

http://alfandega.sourceforge.net/
Christian Tosta

Version history: ChangeLog
Installation instructions: INSTALL
General notes: README
Development Guide: DEVELOPERS

Creating Profiles

Alfandega profiles are shell script that execute specific iptables commands to configure a firewall. Make a profile is simple. You can only follow any rules while creating your script:

Your script must have these procedures and only these to run with alfandega:

id() - Here you need to define the shell script variable $PROFILE_NAME:

id()
{
  PROFILE_NAME="Foo_profile"
}

run() - Here you need to use this model with same "case" options:

run()
{
case $1 in
  tcp_packets) foo1 command ;;
  udp_packets) foo2 command ;;
  PREROUTING) foo3 command ;;
  POSTROUTING) foo4 command ;;
esac
}

config() - Here you need to put any script to get parameters for profile or to made any configuration. Example:

If don't need nothing to do, simple write "return 0" inside this function.

config()
{
case $1 in
  while :
    echo -n Inform foo IP:
    read ANS
    if [ $ANS ]; then
    exit 0
    fi
  done
esac
}

To end script you must use the follow code:

case $1 in
  config) config ;;
  id) id ;;
  run) run $2 ;;
  *) echo "This script runs only called by Alfandega" ;;
esac