tech-userlevel archive

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

Re: dhc* in NetBSD 7.0

    Date:        Wed, 27 Mar 2013 09:01:23 +0000
    From:        Roy Marples <>
    Message-ID:  <>

  | My recommendation is to let dhcpcd run for all interfaces and if it 
  | needs limiting then use the allowinterfaces and/or denyinterfaces 
  | directive in dhcpcd.conf

That's what I'm doing now, but I really wish I could do it another way.

What that way should be I'm less certain about, but I'd prefer to only
have one place to update (whether that's rc.conf or /etc/ifconfig.ifname)
when interface names change.

I may be somewhat in a minority, but that happens to me a lot - I'm
currently running NetBSD in a virtualbox, which can emulate a bunch
of different network hardware, and I keep altering which way I configure
the VM, leading to different driver selection, and different interface

I can easily link ifconfig.wm0 to ifconfig.pcn0 to ifconfig.vioif0
so the same contents are in each (the rc scripts just use whichever ones
correspond to interfaces that exist, and ignore others ifconfig_xxN vars
in rc.conf have the same basic property), but I would like not to have
to remember to go edit dhcpcd.conf and change the allowinterfaces statement
(I have some (virtual) interfaces that use dhcp, and others that use
static config - some with no IPv4 config at all.)

I used to really like the "dhcp" line in ifconfig.ifname to enable dhcp
on that interface, and it would be really nice if dhcpcd could be made to
run on those interfaces and no others (not for dhcpcd to read those files
of course, the rc.d/network script does that and should pass the appropriate
interface names to dhcpcd, and then only those interfaces run dhcp, any
others should be ignored).

An alternative would be to have the dhcpcd daemon process start very early,
and do nothing at all, and then send it interface names (over a local socket
or fifo) to use as they're discovered (which has the property of reacting 
better to interfaces that appear and disappear, without embedding policy
of which of those need dhcp into dhcpcd itself).

I'm sure there are other ways as well - dhcpcd.conf is fine for configuring
what options to get, and what script to run, etc - but it isn't ideal for
configuring something as dynamic as interface names (plug in a usb wireless
dongle and a new one just appears - do I want dhcp or not ... editing 
dhcpcd.conf isn't really the right solution, since the answer might depend upon
what ssid the wireless actually attaches to.)


Home | Main Index | Thread Index | Old Index