Next: , Previous: Global, Up: Configuration


3.2 The <acl> section

This is basically the firewall section, you can add all your firewall rules here or just leave it blank to use your current firewall.

The syntax for this section is a little more complex and is as follows...

     <firewall>
     .
     .
     .
         <acl>
             <table name="filter">
                 <chain name="INPUT" defualt="ACCEPT">
                     <rule name="excess_connections" target="DROP">
                         excess_connections_to_webserver
                     </rule>
                 </chain>
             </table>
         </acl>
     .
     .
     .
     </firewall>


Explaining the above example, this will add 1 rule to the INPUT chain under the filter table which will drop all new packets that arrive if the concurrent connections on port 80 is higher than 10.

It is the equivalent to...

iptables -t filter -A INPUT -d 192.168.0.10 -p tcp -dport 80 -m connlimit --connlimit-above 10 -j DROP

The following tags and parameters are available...


Using the above, here is an example of a simple firewall which allows http and ssh traffic, assuming your IP address is 10.0.0.2 of course...
     <firewall>
         # Global configuration and access classes
         <global>
             <class name="http_traffic">
                 <address dst="10.0.0.2" proto="tcp" dst-port="80"/>
             </class>
             <class name="ssh_traffic">
                 <address dst="10.0.0.2" proto="tcp" dst-port="22"/>
             </class>
         </global>
     
         # Access control lists
         <acl>
             <table name="filter">
                 <chain name="INPUT" default="DROP">
                     <rule name="allowed_traffic" target="ACCEPT">
                         http_traffic
                         ssh_traffic
                     </rule>
                 </chain>
                 <chain name="FORWARD" default="DROP">
                 </chain>
                 <chain name="OUTPUT" default="ACCEPT">
                 </chain>
             </table>
         </acl>
     </firewall>