Bug 746579

Summary: Default route and ip-down.local handled incorrectly
Product: Red Hat Enterprise Linux 6 Reporter: John Cameron <john>
Component: rp-pppoeAssignee: Than Ngo <than>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0CC: bbs2web, tpelka
Target Milestone: rc   
Target Release: 6.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: rp-pppoe-3.10-13.el6 Doc Type: Bug Fix
Doc Text:
cause: the DEFROUTE and DEFAULTROUTE was not defined and handle correct in the pppoe-connect Consequence: the default route was not set Fix: set DEFROUTE and DEFAULTROUTE in pppoe-connect correctly so that the default route can set Result: the default route is set correctly
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 00:41:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Cameron 2011-10-17 06:47:49 UTC
Description of problem: Default route and ip-down.local handled incorrectly

Version-Release number of selected component (if applicable): rp-pppoe-3.10-8.el6.x86_64

How reproducible: Constant

Steps to Reproduce:

Configure Dual PPPoE config :

yum -q -y install rp-pppoe
PPPOE_DIR=`readlink -f /usr/share/doc/rp-pppoe*`
SAMPLE_PPPOE_CONF=${PPPOE_DIR}/configs/pppoe.conf
SAMPLE_PPPOE_INIT=${PPPOE_DIR}/pppoe-init
USERNAME0=user0
PASSWORD0=pass0
USERNAME1=user1
PASSWORD1=pass1

cp -f $SAMPLE_PPPOE_INIT /etc/init.d/pppoe0 
sed –i “s/\$START/\$START \/etc\/ppp\/pppoe0.conf/” /etc/init.d/pppoe0
sed –i “s/\$STATUS/\$STATUS \/etc\/ppp\/pppoe0.conf/” /etc/init.d/pppoe0
sed –i “s/subsys\/pppoe/subsys\/pppoe0/” /etc/init.d/pppoe0
chmod 755 /etc/init.d/pppoe0
chkconfig --add pppoe0
cp -f $SAMPLE_PPPOE_CONF /etc/ppp/pppoe0.conf 
sed -i 's/^PPPD_EXTRA=.*$/PPPD_EXTRA="unit 0"/' /etc/ppp/pppoe0.conf
sed -i "s/^DEFAULTROUTE=.*$/DEFAULTROUTE=yes/" /etc/ppp/pppoe1.conf
echo "\"$USERNAME0\"     * \"$PASSWORD0\"     \"\"" >> /etc/ppp/pap-secrets
sed -i "s/^USER=.*$/USER=${USERNAME0}/" /etc/ppp/pppoe0.conf
service pppoe0 start

cp -f $SAMPLE_PPPOE_INIT /etc/init.d/pppoe1
sed –i “s/\$START/\$START \/etc\/ppp\/pppoe1.conf/” /etc/init.d/pppoe1
sed –i “s/\$STATUS/\$STATUS \/etc\/ppp\/pppoe1.conf/” /etc/init.d/pppoe1
sed –i “s/subsys\/pppoe/subsys\/pppoe1/” /etc/init.d/pppoe1
chmod 755 /etc/init.d/pppoe1
chkconfig --add pppoe1
cp -f $SAMPLE_PPPOE_CONF /etc/ppp/pppoe1.conf
sed -i 's/^PPPD_EXTRA=.*$/PPPD_EXTRA="unit 1"/' /etc/ppp/pppoe1.conf
sed -i "s/^DEFAULTROUTE=.*$/DEFAULTROUTE=no/" /etc/ppp/pppoe1.conf
echo "\"$USERNAME1\"     * \"$PASSWORD1\"     \"\"" >> /etc/ppp/pap-secrets
sed -i "s/^USER=.*$/USER=${USERNAME1}/" /etc/ppp/pppoe1.conf
service pppoe1 start

Actual results:

1. Check Default Route :

Run : ip route show | grep default

Result : default dev ppp0  scope link

2. Restart Second PPPoE and check Default Route :

Run : service pppoe1 restart

Run : ip route show | grep default

Result : null

Expected results:

Run : ip route show | grep default

Result : default dev ppp0  scope link

Additional info:

1. DEFROUTE variable not defined or parsed 

Fix : sed -i '/if test "\$DEFROUTE"/ iDEFROUTE=\$DEFAULTROUTE' /sbin/pppoe-connect

2. “nodefaultroute” has to be specified via PPPD_EXTRA in pppoe1.conf even when DEFAULTROUTE=no is specified

Fix : sed -i 's/DEFAULTROUTE=""/DEFAULTROUTE="nodefaultroute"/g' /sbin/pppoe-connect

3. “/sbin/pppoe-stop” kills process therefor ip-down.local not parsed 

Fix : sed -i "/exit 0/ i[ -x \/etc\/ppp\/ip-down.local ] && \/etc\/ppp\/ip-down.local > \/dev\/null 2>&1" /sbin/pppoe-stop

Comment 2 RHEL Program Management 2011-10-17 07:08:36 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 4 Suzanne Logcher 2012-02-14 23:17:46 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 14 errata-xmlrpc 2016-05-11 00:41:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0923.html

Comment 15 David Herselman 2016-06-07 11:33:35 UTC
Grrr... This now breaks default route selection which has been working perfectly for 10+ years:

We define connection via ifcfg-ppp# configuration script:

/etc/sysconfig/network-scripts/ifcfg-ppp0
USERCTL=yes
BOOTPROTO=dialup
NAME=DSLppp0
DEVICE=ppp0
TYPE=xDSL
ONBOOT=no
PIDFILE=/var/run/pppoe-adsl.pid
FIREWALL=NONE
PING=.
PPPOE_TIMEOUT=80
LCP_FAILURE=3
LCP_INTERVAL=20
CLAMPMSS=1412
CONNECT_POLL=6
CONNECT_TIMEOUT=60
DEFROUTE=no
SYNCHRONOUS=no
ETH=vlan11
PROVIDER=DSLppp0
USER=syrexd2354.co.za
PEERDNS=no
PPPD_EXTRA='ipparam out2'


pppoe-connect now incorrectly sets 'defaultroute':
root     15098  0.0  0.0   9240  1216 ?        S    13:26   0:00 /bin/bash /sbin/pppoe-connect /etc/sysconfig/network-scripts/ifcfg-ppp0
root     15122  0.0  0.0  21896  1344 ?        Ss   13:26   0:00  \_ /usr/sbin/pppd pty /usr/sbin/pppoe -p /var/run/pppoe-adsl.pid.pppoe -I vlan11 -T 80 -U  -m 1412    ipparam ppp0 linkname ppp0 noipdefault noauth default-asyncmap defaultroute hide-password nodetach mtu 1492 mru 1492 noaccomp nodeflate nopcomp novj novjccomp user syrexd2354.co.za lcp-echo-interval 20 lcp-echo-failure 3 ipparam out2

Comment 16 David Herselman 2016-06-07 11:44:14 UTC
Problem is that /sbin/pppoe-connect redefines DEFROUTE here:

DEFROUTE=$DEFAULTROUTE
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 match 0/0)
    [ -n "${DEFRT}" ] && echo "$DEFRT" > /etc/default-routes
    echo "$DEFRT" | while read spec; do
        ip route del $spec;
    done
else
    DEFAULTROUTE="nodefaultroute"
fi

The script subsequently now always sets DEFROUTE='defaultroute' when DEFROUTE is defined in ifcfg-ppp#

RedHat definitely broke this by accident, work around would either be to comment out the 'DEFROUTE=$DEFAULTROUTE' statement or change ifcfg-ppp# definition to use 'DEFAULTROUTE=no' instead of 'DEFROUTE=no',