Subject: Re: preconfiguring dhclient interfaces
To: Luke Mewburn <>
From: Steven M. Bellovin <>
List: netbsd-users
Date: 11/24/2002 20:57:26
In message <>, Luke Mewburn writes:
>On Fri, Nov 22, 2002 at 10:57:18AM -0500, Steve Bellovin wrote:
>  | I want to ensure that dhclient only runs on certain interfaces, to 
>  | prevent it from overwriting the static address for vmnet1.  I can't set 
>  | dhclient_flags, because wi0 is sometimes present and sometimes not.  
>  | Instead, I wrote the following script, which I put into
>  | /etc/rc.conf.d/dhclient (though it could -- should? -- go into
>  | /etc/rc.d/dhclient.
>There's an easier way; just list the interfaces you want dhclient to
>attempt to use in /etc/dhclient.conf.  For example, on my laptop I have:
>	interface "wi0" {
>		media "-mediaopt adhoc nwid SOMETHING nwkey SOMETHINGELSE";
>		media "-mediaopt adhoc nwid '' -nwkey";
>		media "mediaopt adhoc -nwkey";
>	}
>	interface "tlp0" {
>	}
>dhclient only tries wi0 (if present), cycling through the media
>options on each retry, and tlp0 (if present); it doesn't try other 
>"broadcast capable" interfaces that may be available.
>I'd be curious to know if this solution works for you or not.

It did indeed -- many thanks.

		--Steve Bellovin, (me) ("Firewalls" book)