How to configure dhcp to listen to a specific interface instead of 0.0.0.0?

Glenn Satchell glenn.satchell at uniq.com.au
Tue Jul 6 06:58:33 UTC 2010


Even though netstat shows dhcpd has a socket open that is listening, but 
it only processes dhcp requests on the named interface.

You can also use the local-address statement, but beware the special 
requirements.

$ man dhcpd.conf
...
      The local-address statement

        local-address address;

        This statement causes the DHCP server to listen  for  DHCP
        requests  sent  to  the  specified  address,  rather  than
        requests sent to all addresses.   Since  serving  directly
        attached DHCP clients implies that the server must respond
        to requests sent to the all-ones IP address,  this  option
        cannot  be  used  if  clients  are  on  directly  attached
        networks...it is only realistically useful  for  a  server
        whose  only  clients are reached via unicasts, such as via
        DHCP relay agents.

        Note:  This statement is only effective if the server  was
        compiled using the USE_SOCKETS #define statement, which is
        default on a small number of operating systems,  and  must
        be  explicitly chosen at compile-time for all others.  You
        can be sure if your server is compiled with USE_SOCKETS if
        you see lines of this format at startup:

         Listening on Socket/eth0

        Note also that since this bind()s all DHCP sockets to  the
        specified  address, that only one address may be supported
        in a daemon at a given time.

regards,
-glenn

On 07/06/10 15:01, Baomin Wang wrote:
> Hi,
>
> I have run the dhcpd command as following:
>
> $ dhcpd eth0
>
> But when I checked the running result by netstat:
>
> $ netstat -an|grep 67
>
> udp 0 0 0.0.0.0:67 0.0.0.0:*
>
> udp 0 0 0.0.0.0:67 0.0.0.0:*
>
> Dhcpd process is still listening on 0.0.0.0. How can I start dhcpd to
> listen to a specific interface?
>
> B.R.
>
> Baomin Wang
>



More information about the dhcp-users mailing list