The SUSE mainteners made a patch ppp-2.4.2-cifdefroute.diff (cf. attachment) to add "replacedefaultroute" option.
Information from suse man page:
This option is a flag to the defaultroute option. If defaultroute is
set and this flag is also set, pppd replaces an existing default route
with the new default route.
I have tried to adapt the patch with the actual version of ppp inside Gentoo, but my knowledge of PPP is too bad for this, my ebuild doesn't work.
The source package: ftp://ftp.free.fr/mirrors/ftp.opensuse.org/opensuse/distribution/10.3/repo/src-oss/suse/src/ppp-2.4.4-70.src.rpm
This option is useful with a laptop always online with ppp+bluetooth+gprs and local network.
Created attachment 156993 [details, diff]
the patch from SUSE
This should really go through upstream...
This replacedefaultroute is really a misfeature from my POV because you will be left without a default route when pppd will be killed by the user with kill -9 (possibly with other signals as well, I didn't looked at their patch). We (or at least I) like a different approach to this problem. Instead of blindly replacing the default route, I let users choose the metric of the default route created by pppd (see defaultmetric option in pppd man page). This way you could adapt your setup to whatever needs you have, all you need to do is set the right metric on the right route.
Anyway, did you looked at the current pppd version in our tree? Do you really expect us to add such an old (and probably rejected by upstream) patch to our source tree? :)
Closed as INVALID.
Okay, thanks you very much for this information.
I'm not a PPP developer, I only want a solution for my problem.
I had found only this patch to resolve this.
Your solution is okay for me.