Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1828 → Rev 1829

/conf/etc/alcasar-iptables-local.sh
2,19 → 2,15
# $Id$
# script de mise en place des regles personnalisées du parefeu d'Alcasar
# Rexy - 3abtux - CPN
# version 2.1 (12/2014)
# version 2.2 (04/2016)
# changelog :
# + autorisation de l'ICMP vers EXTIF
# + autorisation SMTP vers serveur extérieur (SMTP_IP)
# + autorisation PAT depuis l'extérieur
# List of MAC filtered in /usr/local/etc/alcasar-iptables-local-filtered ; format : aa:09:23:2f:4d:ee
 
CONF_FILE="/usr/local/etc/alcasar.conf"
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace
 
# filtrage particulier ciblés
if [ -s /usr/local/etc/alcasar-iptables-local-filtered ]; then
# + example to allow ICMP from an Internet IP address (Admin_from) to EXTIF
# + exemple to allow SMTP from aLCASAR to an Internet server (SMTP_IP)
# + exemple of PAT rules from Internet
# + List of local MAC addresses filtered (MAC are in '/usr/local/etc/alcasar-iptables-local-mac-filtered'. Format : aa:09:23:2f:4d:ee)
# this script inherit of alcasar-iptables.sh variables : $INTIF, $EXTIF, $IPTABLES, etc
# Local MAC addresses filtering
if [ -s /usr/local/etc/alcasar-iptables-local-mac-filtered ]; then
while read mac_line
do
ip_on=`echo $mac_line|cut -b1`
27,7 → 23,7
$IPTABLES -A FORWARD -i $INTIF -p udp -m mac --mac-source $mac_filtered -j DROP
$IPTABLES -A FORWARD -i $INTIF -m mac --mac-source $mac_filtered -j DROP
fi
done < /usr/local/etc/alcasar-iptables-local-filtered
done < /usr/local/etc/alcasar-iptables-local-mac-filtered
fi
 
# On autorise le ping (echo & request) (icmp N°0 & 8) en provenance de l'extérieur vers ALCASAR