dhcpcd-discuss

Re: Race between dhcpcd and ppp while trying to update openresolv?

Ed W

Fri Mar 11 11:33:07 2011

Hi

> On Linux not so much, but definitely for BSD. The issue is one of
> routing mainly and choosing if the default route should run over PPP or
> use the existing. dhcpcd handles this by managing the routing table via
> use of interface metrics, lowest wins. This allows the user to decide
> which one to have.

Thanks Roy.  Great confirmation.

I have since discovered a follow-on ppp/openrc gremlin - I realise this
isn't the openrc list and you aren't very friendly towards PPP, but
since it's semi related I will describe a little more here...

Using "oldnet" in openrc, I start a PPP connection to a 3G device and
specify "persist" and "demand".  Basically this instructs ppp to set a
default gateway, but only bring up the link if it sees traffic across
the gateway.  However, when the link comes down, gentoo is shipping
/etc/ppp/ip-down.sh/50-initd.sh - this in turn does something like:
	IN_BACKGROUND="true" net.ppp0 --quiet stop
At this point oldnet then removes ALL IPs associated with the interface
ppp0, which obviously includes the default gateway, and in turn "demand"
stops working

For my purposes I have no use for 50-initd.sh with PPP, but I guess a
wider question is "who" benefits from this script at all when using PPP?
 My guess is that it's there for when you have a chain of dependent
modules such as with a VPN or similar?  Is this about right?


The whole "demand" concept seems rather at odds with current Openrc
(looking at 0.6.8).  I could see that
- net.lo/down() could be altered to specifically ignore all PPP devices
- pppd.sh could be altered to set some variable which are then checked
in net.lo/down()
- 50-initd.sh could be made smarter

I also realise that "oldnet" is deprecated and supposed to go away in
your vision, but curious if you have any feedback on how it could be
adjusted...


For the benefit of google, the quickest solution for my needs is going
to be to use "ipparam" in the pppd config, this sets a param you can
test for in the ip-down scripts and then customise those scripts
appropriately...


For background, for this project (basically an embedded multi-wan,
multi-lan router) I have currently switched back to doing everything
through "oldnet" and leaving dhcpcd non demonised, ie started per
interface by "oldnet".  I may hit a dead-end in the future, but at the
moment "oldnet" is allowing me to centralise my (user configurable via
web interface) varied net configs in as few files as possible.

Thanks Roy for OpenRC/Dhcpcd and all the other pieces that have made
this all possible

Cheers

Ed W

References:
Race between dhcpcd and ppp while trying to update openresolv?Ed W
Re: Race between dhcpcd and ppp while trying to update openresolv?Ed W
Re: Race between dhcpcd and ppp while trying to update openresolv?Roy Marples
Archive administrator: postmaster@marples.name