Line 1... |
Line 1... |
1 |
#!/bin/sh
|
1 |
#!/bin/sh
|
2 |
# $Id: alcasar.sh 68 2010-04-14 19:50:46Z franck $
|
2 |
# $Id: alcasar.sh 70 2010-04-14 20:01:09Z franck $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
5 |
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
|
7 |
|
Line 321... |
Line 321... |
321 |
[ -e /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF ] || cp /etc/sysconfig/network-scripts/ifcfg-$EXTIF /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF
|
321 |
[ -e /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF ] || cp /etc/sysconfig/network-scripts/ifcfg-$EXTIF /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF
|
322 |
EXT_IP=`grep IPADDR /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2` # @ip du portail (côté Internet)
|
322 |
EXT_IP=`grep IPADDR /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2` # @ip du portail (côté Internet)
|
323 |
[ -e /etc/sysconfig/network.default ] || cp /etc/sysconfig/network /etc/sysconfig/network.default
|
323 |
[ -e /etc/sysconfig/network.default ] || cp /etc/sysconfig/network /etc/sysconfig/network.default
|
324 |
DNS1=`grep DNS1 /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2` # @ip 1er DNS
|
324 |
DNS1=`grep DNS1 /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2` # @ip 1er DNS
|
325 |
DNS2=`grep DNS2 /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2` # @ip 2ème DNS
|
325 |
DNS2=`grep DNS2 /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2` # @ip 2ème DNS
|
- |
|
326 |
DNS1=${DNS1:=208.67.220.220}
|
- |
|
327 |
DNS2=${DNS2:=208.67.222.222}
|
326 |
EXT_NETMASK=`grep NETMASK /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2`
|
328 |
EXT_NETMASK=`grep NETMASK /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2`
|
327 |
EXT_GATEWAY=`grep GATEWAY /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2`
|
329 |
EXT_GATEWAY=`grep GATEWAY /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2`
|
328 |
echo "- Adresse IP 'côté Internet' ($EXTIF) : $EXT_IP / $EXT_NETMASK" >> $FIC_PARAM
|
330 |
echo "- Adresse IP 'côté Internet' ($EXTIF) : $EXT_IP / $EXT_NETMASK" >> $FIC_PARAM
|
329 |
echo "- Serveurs DNS renseignés : $DNS1 et $DNS2" >> $FIC_PARAM
|
331 |
echo "- Serveurs DNS renseignés : $DNS1 et $DNS2" >> $FIC_PARAM
|
330 |
echo "- Routeur de sortie : $EXT_GATEWAY" >> $FIC_PARAM
|
332 |
echo "- Routeur de sortie : $EXT_GATEWAY" >> $FIC_PARAM
|
Line 984... |
Line 986... |
984 |
[ -e /var/lib/named/etc/trusted_networks_acl.conf.default ] || cp /var/lib/named/etc/trusted_networks_acl.conf /var/lib/named/etc/trusted_networks_acl.conf.default
|
986 |
[ -e /var/lib/named/etc/trusted_networks_acl.conf.default ] || cp /var/lib/named/etc/trusted_networks_acl.conf /var/lib/named/etc/trusted_networks_acl.conf.default
|
985 |
[ -e /var/lib/named/etc/named.conf.default ] || cp /var/lib/named/etc/named.conf /var/lib/named/etc/named.conf.default
|
987 |
[ -e /var/lib/named/etc/named.conf.default ] || cp /var/lib/named/etc/named.conf /var/lib/named/etc/named.conf.default
|
986 |
[ -e /var/lib/named/var/named/master/localdomain.zone.default ] || cp /var/lib/named/var/named/master/localdomain.zone /var/lib/named/var/named/master/localdomain.zone.default
|
988 |
[ -e /var/lib/named/var/named/master/localdomain.zone.default ] || cp /var/lib/named/var/named/master/localdomain.zone /var/lib/named/var/named/master/localdomain.zone.default
|
987 |
$SED "s?127.0.0.1;.*?127.0.0.1; $CUSTOM_PRIVATE_NETWORK_MASK;?g" /var/lib/named/etc/trusted_networks_acl.conf
|
989 |
$SED "s?127.0.0.1;.*?127.0.0.1; $CUSTOM_PRIVATE_NETWORK_MASK;?g" /var/lib/named/etc/trusted_networks_acl.conf
|
988 |
$SED "s?listen-on.*?listen-on port 53 \{ 127.0.0.1; $PRIVATE_IP; \};?g" /var/lib/named/etc/named.conf
|
990 |
$SED "s?listen-on.*?listen-on port 53 \{ 127.0.0.1; $PRIVATE_IP; \};?g" /var/lib/named/etc/named.conf
|
989 |
$SED "s?^\/\/[ ]*forwarders.*? forward only; forwarders { ${DNS1:=208.67.222.222}; ${DNS2:=208.67.220.220}; };?g" /var/lib/named/etc/named.conf
|
991 |
$SED "s?^\/\/[ ]*forwarders.*? forward only; forwarders { $DNS1; $DNS2; };?g" /var/lib/named/etc/named.conf
|
990 |
# $SED "s?^\/\/ include \"\/etc\/bogon_acl.conf\";.*?include \"\/etc\/bogon_acl.conf\";?g" /var/lib/named/etc/named.conf
|
992 |
# $SED "s?^\/\/ include \"\/etc\/bogon_acl.conf\";.*?include \"\/etc\/bogon_acl.conf\";?g" /var/lib/named/etc/named.conf
|
991 |
# On crée l'entrée pour le reverse
|
993 |
# On crée l'entrée pour le reverse
|
992 |
for i in $(seq $classe -1 1)
|
994 |
for i in $(seq $classe -1 1)
|
993 |
do
|
995 |
do
|
994 |
echo -n `echo $PRIVATE_NETWORK|cut -d"." -f$i`. >> /tmp/rev.txt
|
996 |
echo -n `echo $PRIVATE_NETWORK|cut -d"." -f$i`. >> /tmp/rev.txt
|