Captive Portal support for portal named $portalname:
- 1 network interface name per line to be guarded by this portal
  in $CONFIGDIR/feature/portal/$portalname/interfaces.
  There is only one supported portal per interface.
- $CONFIGDIR/feature/portal/$portalname/ipset-name
- $CONFIGDIR/feature/portal/$portalname/dnat: unknown clients are
  handled here, e.g. redirect to portal website
- $CONFIGDIR/feature/portal/$portalname/privclients: unknown clients may
  access certain things, e.g. DNS, portal website
- $CONFIGDIR/feature/portal/$portalname/clients-static: static mac/IP
  combinations Format:
  IP MAC Comment
  make sure the ip/mac combination stays the same, e.g. via static
  ips/dhcp-server configuration

Restrictions:
- maximum name length for portal: 21 characters
- no dns-targets in portal dnat and privclients
- static clients load only on firewall-lihasd.pl startup and you need to
  run "echo gnarf | nc localhost 83" to activate

Sample:
Create a portal 'testportal' using ipset 'testportal', ip-range of
clients is 192.168.15.0/24 on wlan1, portalserver is 192.168.15.1:
mkdir -p /etc/firewall.lihas.d/feature/portal/testportal
echo testportal > /etc/firewall.lihas.d/feature/portal/testportal/ipset-name
mkdir -p /etc/firewall.lihas.d/groups/ipset/ipset-testportal
echo "bitmap:ip,mac range 192.168.15.0/24" > /etc/firewall.lihas.d/groups/ipset/ipset-testportal/setup
echo wlan1 > /etc/firewall.lihas.d/feature/portal/testportal/interfaces
echo "0.0.0.0/0 192.168.15.1 tcp 81" > /etc/firewall.lihas.d/feature/portal/testportal/privclients
echo "0.0.0.0/0 192.168.15.1 tcp 82" >> /etc/firewall.lihas.d/feature/portal/testportal/privclients
echo "0.0.0.0/0 192.168.15.1 tcp 80 81" > /etc/firewall.lihas.d/feature/portal/testportal/dnat

echo 192.168.15.1 portalserver.lan >> /etc/hosts
mkdir -p /var/www/portalserver.lan


cat <<EOF >/etc/apache2/sites-available/001-portalserver.lan.conf 
<VirtualHost *:80>
        ServerName portalserver.lan
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/portalserver.lan
        ErrorLog ${APACHE_LOG_DIR}/portalserver.lan-error.log
        CustomLog ${APACHE_LOG_DIR}/portalserver.lan-access.log combined

        # enable CGI
        Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<VirtualHost *:82>
        ServerName portalserver.lan
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/portalserver.lan
        ErrorLog ${APACHE_LOG_DIR}/portalserver.lan-error.log
        CustomLog ${APACHE_LOG_DIR}/portalserver.lan-access.log combined

        # enable CGI
        Include conf-available/serve-cgi-bin.conf
</VirtualHost>
EOF
a2ensite 001-portalserver.lan.conf

# www-data / webserver needs access
chgrp www-data /var/lib/firewall-lihas/db.sqlite
chmod g+w /var/lib/firewall-lihas/db.sqlite
chgrp www-data /var/lib/firewall-lihas
chmod g+w /var/lib/firewall-lihas

