331,7 → 331,7 |
PRIVATE_IP_MASK=`grep PRIVATE_IP conf/etc/alcasar.conf|cut -d"=" -f2` |
rm -rf conf/etc/alcasar.conf |
fi |
# Define Lan side Ethernet card |
# Define Lan side parameters |
hostname $HOSTNAME |
PRIVATE_NETWORK=`/bin/ipcalc -n $PRIVATE_IP_MASK | cut -d"=" -f2` # private network address (ie.: 192.168.182.0) |
PRIVATE_NETMASK=`/bin/ipcalc -m $PRIVATE_IP_MASK | cut -d"=" -f2` # private network mask (ie.: 255.255.255.0) |
345,7 → 345,7 |
private_broadcast_ending=`echo $PRIVATE_BROADCAST | cut -d"." -f$classe_sup` # last octet of LAN broadcast |
PRIVATE_FIRST_IP=`echo $PRIVATE_NETWORK | cut -d"." -f1-3`"."`expr $private_network_ending + 1` # First network address (ex.: 192.168.182.1) |
PRIVATE_LAST_IP=`echo $PRIVATE_BROADCAST | cut -d"." -f1-3`"."`expr $private_broadcast_ending - 1` # last network address (ex.: 192.168.182.254) |
# Define Internet side Ethernet card |
# Define Internet parameters |
[ -e /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF ] || cp /etc/sysconfig/network-scripts/ifcfg-$EXTIF /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF |
DNS1=`grep DNS1 /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2` # @ip 1er DNS |
DNS2=`grep DNS2 /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF|cut -d"=" -f2` # @ip 2ème DNS |
363,19 → 363,19 |
echo "PRIVATE_IP=$PRIVATE_IP_MASK" >> $CONF_FILE |
echo "DHCP=on" >> $CONF_FILE |
[ -e /etc/sysconfig/network.default ] || cp /etc/sysconfig/network /etc/sysconfig/network.default |
# Renseignement des fichiers de configuration réseau |
# config network |
cat <<EOF > /etc/sysconfig/network |
NETWORKING=yes |
HOSTNAME="$HOSTNAME" |
FORWARD_IPV4=true |
EOF |
# Modif /etc/hosts |
# config /etc/hosts |
[ -e /etc/hosts.default ] || cp /etc/hosts /etc/hosts.default |
cat <<EOF > /etc/hosts |
127.0.0.1 localhost |
$PRIVATE_IP $HOSTNAME |
EOF |
# Configuration de l'interface eth0 (Internet) |
# Config eth0 (Internet) |
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF |
DEVICE=$EXTIF |
BOOTPROTO=static |
392,9 → 392,19 |
ACCOUNTING=no |
USERCTL=no |
EOF |
# Configuration de l'interface eth1 (réseau de consultation) |
# utile uniquement pour le mode bypass (cf. alcasar-bypass.sh) |
rm -f /etc/sysconfig/network-scripts/ifcfg-$INTIF |
# Config eth1 (consultation LAN) in normal mode |
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$INTIF |
DEVICE=$INTIF |
BOOTPROTO=static |
ONBOOT=yes |
NOZEROCONF=yes |
MII_NOT_SUPPORTED=yes |
IPV6INIT=no |
IPV6TO4INIT=no |
ACCOUNTING=no |
USERCTL=no |
EOF |
# Config of eth1 in bypass mode (see "alcasar-bypass.sh") |
cat <<EOF > /etc/sysconfig/network-scripts/default-ifcfg-$INTIF |
DEVICE=$INTIF |
BOOTPROTO=static |
911,9 → 921,8 |
pidfile /var/run/chilli.eth1.pid |
net $PRIVATE_NETWORK_MASK |
dhcpif $INTIF |
dynip $PRIVATE_NETWORK_MASK |
ethers $DIR_DEST_ETC/alcasar-ethers |
#statip |
ethers $DIR_DEST_ETC/alcasar-ethers |
domain localdomain |
dns1 $PRIVATE_IP |
dns2 $PRIVATE_IP |