Subversion Repositories ALCASAR

Rev

Rev 1872 | Rev 1896 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1872 Rev 1876
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-iptables.sh 1872 2016-05-05 08:45:44Z richard $
2
# $Id: alcasar-iptables.sh 1876 2016-05-06 16:14:56Z raphael.pion $
3
# Script de mise en place des regles du parefeu d'Alcasar (mode normal)
3
# Script de mise en place des regles du parefeu d'Alcasar (mode normal)
4
# This script writes the netfilter rules for ALCASAR
4
# This script writes the netfilter rules for ALCASAR
5
# Rexy - 3abtux - CPN
5
# Rexy - 3abtux - CPN
6
#
6
#
7
# Reminders
7
# Reminders
Line 96... Line 96...
96
#          IPSET            #
96
#          IPSET            #
97
#############################
97
#############################
98
 
98
 
99
# destruction de tous les SET
99
# destruction de tous les SET
100
# destroy all SET
100
# destroy all SET
-
 
101
ipset flush
101
ipset destroy
102
ipset destroy
102
 
103
 
103
ipset flush bl_ip_blocked
-
 
104
ipset destroy bl_ip_blocked
-
 
105
ipset flush wl_ip_allowed
-
 
106
ipset destroy wl_ip_allowed
-
 
107
###### BL set  ###########
104
###### BL set  ###########
108
# Calcul de la taille / Compute the length
105
# Calcul de la taille / Compute the length
109
bl_set_length=$(($(wc -l $BL_IP_CAT/* | awk '{print $1}' | tail -n 1)+$(wc -l $BL_IP_OSSI | awk '{print $1}')))
106
bl_set_length=$(($(wc -l $BL_IP_CAT/* | awk '{print $1}' | tail -n 1)+$(wc -l $BL_IP_OSSI | awk '{print $1}')))
110
# Chargement / loading
107
# Chargement / loading
111
echo "create bl_ip_blocked hash:net family inet hashsize 1024 maxelem $bl_set_length" > $TMP_set_save
108
echo "create bl_ip_blocked hash:net family inet hashsize 1024 maxelem $bl_set_length" > $TMP_set_save