| Line 1... |
Line 1... |
| 1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
| 2 |
# $Id: alcasar-iptables-bypass.sh 64 2010-04-08 20:01:24Z franck $
|
2 |
# $Id: alcasar-iptables-bypass.sh 321 2010-11-16 21:48:38Z franck $
|
| 3 |
|
3 |
|
| 4 |
# script d'initialisation des regles du parefeu en mode ByPass
|
4 |
# script d'initialisation des regles du parefeu en mode ByPass
|
| 5 |
# Rexy - 3abtux
|
5 |
# Rexy - 3abtux
|
| 6 |
# version 1.8 - 12/2009
|
6 |
# version 2.0 - 12/2010
|
| 7 |
# changelog :
|
7 |
# changelog :
|
| - |
|
8 |
# + Prise en compte de regles locales
|
| 8 |
# + prise en compte optionnelle d'un fichier iptables 'personnel' permettant de bloquer certains flux/services
|
9 |
# + prise en compte optionnelle d'un fichier iptables 'personnel' permettant de bloquer certains flux/services
|
| 9 |
# + suppression log vers syslog
|
10 |
# + suppression log vers syslog
|
| 10 |
# + suppression du broadcast et du multicast sur les interfaces
|
11 |
# + suppression du broadcast et du multicast sur les interfaces
|
| 11 |
|
12 |
|
| 12 |
IPTABLES="/sbin/iptables"
|
13 |
IPTABLES="/sbin/iptables"
|
| Line 38... |
Line 39... |
| 38 |
$IPTABLES -A INPUT -i lo -j ACCEPT
|
39 |
$IPTABLES -A INPUT -i lo -j ACCEPT
|
| 39 |
|
40 |
|
| 40 |
# on autorise les requêtes dhcp
|
41 |
# on autorise les requêtes dhcp
|
| 41 |
$IPTABLES -A INPUT -i $INTIF -p udp -m udp --sport bootpc --dport bootps -j ACCEPT
|
42 |
$IPTABLES -A INPUT -i $INTIF -p udp -m udp --sport bootpc --dport bootps -j ACCEPT
|
| 42 |
|
43 |
|
| - |
|
44 |
# On ajoute ici les règles spécifiques de filtrage réseau
|
| - |
|
45 |
if [ -f /usr/local/etc/alcasar-iptables-local.sh ]; then
|
| - |
|
46 |
. /usr/local/etc/alcasar-iptables-local.sh
|
| - |
|
47 |
fi
|
| - |
|
48 |
|
| 43 |
# Règles d'antispoofing
|
49 |
# Règles d'antispoofing
|
| 44 |
$IPTABLES -A INPUT -i $INTIF ! -s $PRIVATE_NETWORK_MASK -j ULOG --ulog-prefix "RULE Antispoof1 -- DENY "
|
50 |
$IPTABLES -A INPUT -i $INTIF ! -s $PRIVATE_NETWORK_MASK -j ULOG --ulog-prefix "RULE Antispoof1 -- DENY "
|
| 45 |
$IPTABLES -A INPUT -i $INTIF ! -s $PRIVATE_NETWORK_MASK -j DROP
|
51 |
$IPTABLES -A INPUT -i $INTIF ! -s $PRIVATE_NETWORK_MASK -j DROP
|
| 46 |
$IPTABLES -A INPUT -i $EXTIF -s $PRIVATE_NETWORK_MASK -j ULOG --ulog-prefix "RULE Antispoof2 -- DENY "
|
52 |
$IPTABLES -A INPUT -i $EXTIF -s $PRIVATE_NETWORK_MASK -j ULOG --ulog-prefix "RULE Antispoof2 -- DENY "
|
| 47 |
$IPTABLES -A INPUT -i $EXTIF -s $PRIVATE_NETWORK_MASK -j DROP
|
53 |
$IPTABLES -A INPUT -i $EXTIF -s $PRIVATE_NETWORK_MASK -j DROP
|