LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 12-05-2005, 08:22 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
PPP daemon fails to reset the default gateway


I'm using Slackware 10.2, KDE 3.4.3, PPP 2.4.4b1

I've run into an interesting problem. In /etc/rc.d/rc.inet.conf, if I set the GATEWAY variable, then when I dialup the PPP daemon fails to reset the default gateway in the routing table. The pppd option of defaultroute is set in the /etc/ppp/options config file.

If I disable the GATEWAY variable and restart the rc.inet scripts, or manually disable the default gateway in the routing table (route del default), then pppd correctly sets the default table.

I am unable to find any clues about this behavior. In my NT4 box I have no such problems seamlessly toggling between dialup and using a gateway. Therefore the problem seems localized to either the ppp daemon, Slackware, or how Slack builds the routing table.

I first noticed this problem using KPPP. I verified the defaultroute option was set in the /etc/ppp/options config file, but then I added that option in KPPP as well. No dice. I then dialed out with ppp-go. Same results, thus, the problem seems peculiar to the ppp daemon or how the routing table is configured. Regardless of what I try, the ppp daemon always fails to reset the routing table.

Your thoughts and ideas are appreciated!

Last edited by Woodsman; 12-05-2005 at 08:31 PM.
 
Old 12-05-2005, 08:49 PM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
Well, maybe it was designed to behave that way. I haven't seen documentation about the behaviour the daemon will take when there's already a default route.
You could create try creating a file called /etc/ppp/ip-pre-up and try resseting the default gateway from there. It should be called before the interface goes up.
 
Old 12-05-2005, 09:18 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Quote:
You could create try creating a file called /etc/ppp/ip-pre-up and try resetting the default gateway from there. It should be called before the interface goes up.
I have already done something similar with scripts. I now boot such that either of my two boxes can serve as a gateway, and as I write this I am using NT4 and Box 2 is my gateway. But when I dialup in Slack I wrote a script to forcibly remove the existing default gateway. Upon hanging up I then use another script to restore the other box as the default gateway. Since NT4 does this flawlessly without scripts I merely assumed I should experience the same in Slack. Scripts fix the problem and as you say, this might be by design. But still a frustrating PITA!

The odd thing is that, just like the Windows dialup tool, the KPPP dialer has an option to set the dialup server as the default gateway. But the problem seems to be the ppp daemon itself and not KPPP.

The logs show an entry that pppd is not replacing existing default route, but I don't know where else to look why pppd refuses to do this. This log entry seems to indicate that the defaultroute option is being acknowledged by pppd.
 
Old 12-05-2005, 09:46 PM   #4
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
If my C knowledge isn't wrong and the little look I took at pppd sources is correct, it seems it was designed to behave that way:

Code:
/********************************************************************
 *
 * defaultroute_exists - determine if there is a default route
 */

static int defaultroute_exists (struct rtentry *rt)

<SNIP>

/********************************************************************
 *
 * sifdefaultroute - assign a default route through the address given.
 */

int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
{
    struct rtentry rt;

    if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
        if (rt.rt_flags & RTF_GATEWAY)
            error("not replacing existing default route via %I",
                  SIN_ADDR(rt.rt_gateway));
        else
            error("not replacing existing default route through %s",
                  rt.rt_dev);
        return 0;
    }
As you can see it won't change the default route if there's already one there.
 
Old 12-05-2005, 10:12 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Quote:
As you can see it won't change the default route if there's already one there.
Tyrants!
 
Old 12-15-2005, 11:38 AM   #6
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Possibly I'm missing the big picture, but how can I create the ppp0 device without actually dialing out?

As noted in this discussion, the ppp daemon is designed intentionally not to override an existing default network routing path. However, hopefully one way around this is to add the ppp0 device to the routing list with a metric weight of zero. The new Slack rc scripts adds the eth0 device with a metric weight of one. Thus, with a metric weight of zero the ppp0 device becomes the default routing path but if unavailable the device with the next metric weight would be selected for routing. Therefore, during normal LAN operations the default route is eth0, but when the ppp0 device is activated that path is the default route and eth0 is ignored.

Unfortunately, one cannot manually add a device that does not exist and typically the ppp0 device does not exist until dialing out. How can I initialize/create the ppp0 device without actually dialing out---sort of placing the ppp0 device into standby mode until actually dialing out? Is this possible?

Any ideas?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To start ppp daemon from Linux Pashmina Linux - Networking 2 07-23-2004 04:47 AM
Resetting KDE menu to default layout Red HamsterX Linux - Software 6 04-03-2004 02:40 PM
Resetting KDE and GNOME session to default free_mumia Linux - Newbie 1 01-01-2004 08:46 PM
ppp daemon die cts999 Linux - Newbie 4 08-08-2003 06:57 PM
PPP daemon died unexpectedly mandrake_linux Linux - Networking 2 04-21-2001 06:36 PM


All times are GMT -5. The time now is 01:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration