[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sid / woody ppp not setting default gw



Christopher S. Swingley wrote:
> Hi!
> 
> I have a laptop with an ethernet card connection to a local network
> and a modem for connecting to the Internet.  Earlier versions of pppd
> always reset the default gateway to the dial-in server when I connected
> (and reset it back to eth0 after I hang up).  A recent upgrade seems
> to have broken this:
> 
>     Jul 27 19:19:14 machine pppd[15272]: not replacing existing default 
>     route to eth0 [192.168.97.1]

I always had problems getting pppd to set a default gw when I had an
existing gw set up on eth0 with the older versions of pppd.  I now am
using cable and am not "current" on the newer version(s)(2.4 series). 
Some external dialers would do this for you (kppp comes to mind), but
the default ppp dialer that comes with Debian never would work for me. 
I got the same message as you....

> 
> I was able to get things to work by creating routing scripts in
> /etc/ppp/ip-up.d:
> 
>     #!/bin/sh
> 
>     route add -net 137.229.94.19 dev ppp0
>     logger -p daemon.debug Added route to 137.229.94.19 on ppp0
> 
>     route add default gw 137.229.94.19
>     logger -p daemon.debug Added default gateway to 137.229.94.19
> 
>     route del default gw 192.168.97.1
>     logger -p daemon.debug Deleted default gateway to 192.168.97.1
> 
>     exit 0
> 
> This does work, but it takes almost a minute for the script to
> complete it's business, and for the changes to be reflected in the
> routing table.

Based on my experience mentioned above, wouldn't it be better to delete
the current eth0 gw FIRST, then add in the other stuff??  In fact, it
would probably be better to delete the existing gw when pppd is
called...if you can figure out a way to do that.  Of course you would
have to add it back in when pppd shuts down.../etc/ppp/ip-down.d/ would
be a great place for a "reset" script.  

Also, if you have other scripts in /etc/ppp/ip-up.d/ then you have to be
careful how you name your scripts.  The scripts are run in cannonical
sequence and you would want this script to be run first, or at least
before any other script that uses the network.  I just took a peek at
mine and it has a single script called "postfix", which runs the mailer
and sends out any mail in the queue.  I would imagine this script would
time-out if run first and a gw had not been set.  This "might" explain
your long delay on getting the new gw set...dunno.  Another option would
be to just place your commands at the front of this file if it exists on
your system.

Just some random thoughts for your consideration.  Hope it helps.

Cheers,
-Don Spoon-



Reply to: