Binding dhclient to a particular network interface

Adam J Richardson fatman.uk at gmail.com
Sun Jul 29 20:27:37 UTC 2007


Jasvinder S. Bahra wrote:
> 
> Is there a way of instructing dhclient to listen only on the cable-modem
> facing network interface?

Hi Jazz,

I don't find it necessary to run dhclient as a daemon. My server has two 
interfaces, one wired and one wifi. In my /etc/rc.conf:

ifconfig_fxp0="DHCP"
ifconfig_ndis0="WPA DHCP"

[You might recognise ndis as the Project Evil driver for using Windows 
network drivers under BSD.]

When the netstart script runs, those two lines have the effect of 
starting wpa_supplicant on ndis0, and running dhclient on both interfaces.

Supposing I temporarily assign a static IP to fxp0, I can revert to DHCP 
by typing:

$ sudo dhclient fxp0

which does some DHCP magic and gets a lease.

If I take ndis0 down I find I have to run /etc/netstart again to get it 
back up, but you didn't want to know that.

HtH
Adam J Richardson


More information about the freebsd-questions mailing list