Well in that case don't trust those scripts and add your on in
/etc/ppp/ip-up.local

use something like

CURDEFROUTE=`netstat -rn | grep "^0.0.0.0" | grep "eth1"`

if [ "$CURDEFROUTE" ]; then
  # Current route is pointing to eth1 still
  route del default
  route add default dev $1   # I think it's $1 for device
fi


WARNING: This code was typed directly into the email and not tested.. you
should also add this code to /etc/ppp/ip-down.local and revserve to commands
so the default route is back to eth1 or whatever your eth device is..

-----Original Message-----
From: Christopher Booth [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 5 February 2002 12:07 PM
To: George Vieira
Subject: Re: [SLUG] routing


It does but, it only works sometimes.

I was looking at the scripts last night, quite complex scripts there.

If I have up the eth0 interface, with or without the default route set, but
no cable plugged in, then when I dial-up no new default route is exported.
I ended up having to add this command to the post connect settings in kppp.
ip route add default dev ppp0 

This is actually in the /etc/sysconfig/network-scripts/ifup command
    # Set a default route.
    if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
        # set up default gateway
        if [ -n "${GATEWAY}" -a "`ipcalc --network ${GATEWAY} ${NETMASK}
2>/dev/null`" = "NETWORK=${NETWORK}" ]; then
            ip route add default via ${GATEWAY}
            DEFGW=${GATEWAY}
        elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
            ip route add default dev ${DEVICE}
        fi
    fi

ifup-ppp0 has this command to delete the default route if found, but I am
not sure that it adds a new default route
.
if [ "${DEFROUTE}" != no ] ; then
  # pppd will no longer delete an existing default route
  # so we have to help it out a little here.
  DEFRT=`ip route list | awk '/^default / { print $3 }'`
  [ -n "${DEFRT}" ] && echo $DEFRT > /etc/default-route
  route del default >/dev/null 2>&1
  opts="$opts defaultroute"
fi

Chris


On Sun, 3 Feb 2002 20:51:39 +1100 
"George Vieira" <[EMAIL PROTECTED]> wrote:


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to