logo

Main Menu
Home
Products
Tips n Tricks
Download
Contacts
About
Login Form





Lost Password?
RedHat PPPOE script deletes default route PDF Print E-mail
When ADSL connections are restarted the default route is always reset. Even if you have "DEFROUTE=no" in /etc/sysconfig/network-scripts/ifcfg-ppp0

This is especially a problem when you have multiple connections and the ADSL does not come back up successfully as you can be left without a default route!

Thanks to Eric Yeo who filed this bug and resolution in Redhat's bugzilla.


Make a backup copy of /sbin/adsl-connect

The problem is that DEFROUTE as a variable is referenced twice, thus the ifcfg-ppp0 entry is overwritten.
By changing a single variable name this behaviour is avoided.

edit it and find the section below...(note: the PPP_STD_OPTIONS lines have been truncated to fit on one page. In the file they are on one line)

if test "$DEFROUTE" != "no" ; then
DEFROUTE="defaultroute"
# 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
else
DEFROUTE=""
fi

# Standard PPP options we always use
PPP_STD_OPTIONS="$IPPARAM $LINKNAME $PLUGIN_OPTS noipdefault noauth \
default-asyncmap $DEFROUTE hide-password nodetach $PEERDNS mtu $MTU mru \
$MRU noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp user \
$USER lcp-echo-interval $LCP_INTERVAL lcp-echo-failure $LCP_FAILURE \
$PPPD_EXTRA"
change the lines bolded above as below....

  if test "$DEFROUTE" != "no" ; then
DEFAULTROUTE="defaultroute"
# 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
else
DEFAULTROUTE=""
fi

# Standard PPP options we always use
PPP_STD_OPTIONS="$IPPARAM $LINKNAME $PLUGIN_OPTS noipdefault noauth \
 default-asyncmap $DEFAULTROUTE hide-password nodetach $PEERDNS mtu $MTU\
 mru $MRU noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp user\
 $USER lcp-echo-interval $LCP_INTERVAL lcp-echo-failure $LCP_FAILURE \
$PPPD_EXTRA"

This was found as a bug in rp-pppoe-3.5-22 by Eric, but i have seen it in rp-pppoe-3.5-14.
To make matters worse it is still a bug in rp-pppoe-3.5-27. I am not sure why the patch has not been integrated into the release as it is a valid fix.


 
 
logo