Binding dhclient to a particular network interface

Jasvinder S. Bahra bbdl21548 at
Mon Jul 30 18:48:19 UTC 2007


I tried adding the interface line to the dhclient configuration file (and
then rebooting), but it had no effect.  Entering the "sockstat -l4" command
showed that local address was still "*:68".

I had a look at the man pages for the configuration file, but other than
trying again with the word "interface" (as opposed to "Interface"), couldn't
think of any other approach.

Thanks for the suggestion though, and if you (or indeed, anyone else) has
any other ideas, please do share.



----- Original Message ----- 
From: "Terry Sposato" <terry at>
To: "'Jasvinder S. Bahra'" <bbdl21548 at>
Cc: <freebsd-questions at>
Sent: Monday, July 30, 2007 1:16 AM
Subject: RE: Binding dhclient to a particular network interface

> Hi Jasvinder,
> I believe if you add the following to /etc/dhclient.conf your problem will
> be resolved.
> Interface "ed1";
> Then reboot or alternatively restart your network and you should finding
> only binding to that interface.
> Regards,
> Terry
> -----Original Message-----
> From: owner-freebsd-questions at
> [mailto:owner-freebsd-questions at] On Behalf Of Jasvinder S.
> Sent: Monday, 30 July 2007 9:27 AM
> To: freebsd-questions at
> Subject: Re: Binding dhclient to a particular network interface
> Adam,
> Thanks for responding, but I think theres been a misunderstanding here.
> The network setup on my machine is working correctly.  My switch-facing
> network card has a fixed IP address, while the cable-modem facing network
> card is assigned one by the DHCP server built into the cable modem.  This
> achieved by the following settings in /etc/rc.conf ...
> network_interfaces="ed1 ed2 lo0"
> ifconfig_ed1="DHCP"
> ifconfig_ed2="inet  netmask"
> ifconfig_lo0="inet"
> The DHCP reference for ed1 means dhclient is started (thereafter running
> continuously as a daemon), which sets ed1's IP address to that assigned by
> the cable modem.
> Note that dhclient generally runs as a daemon because it has to handle
> renewals and/or expiration.  I have no issues with it running as a daemon.
> However, it is listening on all interfaces (which I do have an issue
> i.e. running the command "sockstat -l4" on my system returns...
> USER:  root
> COMMAND:  dhclient
> PID:  267
> FD:  4
> PROTO:  udp4
> As you can see, local address is listed as "*:68", which means its
> on port 68 on all interfaces.  I want to instruct dhclient to only listen
> my cable-modem facing network card.  If this were the case, issuing the
> "sockstat -l4" command would return as above, but with local address
> <<CABLE-MODEM-ASSIGNED-IP-ADDRESS>> is, unsurprisingly, the IP address
> assigned to the network card by the DHCP server in the cable modem).
> Thanks again,
> Jazz

More information about the freebsd-questions mailing list