5.3. Examples of use

Configuration and implementation of lms-mgc might seem quite complex, so we provide small example. Below you can find rules to create and execute quite simple ipchains firewall.

Example 5-1. Lms-mgc: Example instance

You should start with creating new mgc section in lms-mgc.ini, with relevant name ('ipchains') and put a simple masquerade rules, per IP, inside:

[mgc:ipchains]
outfile           = /etc/rc.d/rc.masq
outfile_perm      = 700
header            = #!/bin/sh\n/sbin/ipchains -F\n/sbin/ipchains -X\n/sbin/ipchains -P forward DENY
grantednode_priv  = /sbin/ipchains -A forward -s %IP -j MASQ
post_exec         = /etc/rc.d/rc.masq
You can also add your ipchains subsection to main mgc section, so that it executes it by default:
[mgc]
instances         = ipchains

If you run lms-mgc now, without any arguments, you should have simple script /etc/rc.d/rc.masq generated and already executed.