11,7 → 11,6 |
TMP_ip_gw_save="/tmp/ipset_ip_gw_save" |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` |
PUBLIC_IP=`grep ^PUBLIC_IP= $CONF_FILE|cut -d"=" -f2` |
if [ $PUBLIC_IP != "dhcp" ]; then |
GW1=`grep ^GW= $CONF_FILE|cut -d"=" -f2` |
MTU=`grep ^PUBLIC_MTU= $CONF_FILE|cut -d"=" -f2` |
MULTIWAN=`grep ^MULTIWAN= $CONF_FILE|cut -d"=" -f2` |
25,7 → 24,6 |
PRIVATE_NETWORK=`/bin/ipcalc -n $PRIVATE_IP $PRIVATE_NETMASK| cut -d"=" -f2` # @ réseau de consultation (ex.: 192.168.182.0) |
PRIVATE_NETWORK_MASK=$PRIVATE_NETWORK/$PRIVATE_PREFIX # @ + masque du réseau de consult (192.168.182.0/24) |
nb_gw=`grep ^WAN $CONF_FILE | wc -l` |
fi |
routecmd="ip route replace default scope global" |
|
if [ $(whoami) != "root" ]; then |
59,27 → 57,8 |
--apply) |
[ -e /etc/sysconfig/network-scripts/ifcfg-$EXTIF ] && ifdown $EXTIF |
# set the new configuration for EXTIF |
if [ $PUBLIC_IP == "dhcp" ]; then |
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF |
DEVICE=$EXTIF |
BOOTPROTO=dhcp |
DNS1=127.0.0.1 |
PEERDNS=no |
RESOLV_MODS=yes |
ONBOOT=yes |
NOZEROCONF=yes |
METRIC=10 |
MII_NOT_SUPPORTED=yes |
IPV6INIT=no |
IPV6TO4INIT=no |
ACCOUNTING=no |
USERCTL=no |
MTU=$MTU |
EOF |
ifup $EXTIF |
else |
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF |
DEVICE=$EXTIF |
BOOTPROTO=static |
IPADDR=$IP |
NETMASK=`ipcalc -m $PUBLIC_IP | cut -d= -f2` |
121,8 → 100,6 |
fi |
${routecmd} # define the default gateway for outgoing traffic |
ip route flush cache |
fi |
/usr/local/bin/alcasar-iptables.sh |
exit 0 |
;; |
*) |