<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 09/06/2011 03:00 AM, Simon Hobson wrote:
    <blockquote cite="mid:p0624086bca8b73468f8a@simon.thehobsons.co.uk"
      type="cite">
      <pre wrap="">Steve Clark wrote:

</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">I am using dhcp-4.1.1-11.P1 on EL6. I am running dhcpd without 
specifying an interface
expecting dhcpd to match the interface based on the subnet defined 
in the dhcpd.conf file.
This works as expected unless I have multiple addresses on the 
interface and the
subnet that matches the dhcpd.conf file is not the first address 
listed on the interface.

Is this a known problem? Is there a work around?
</pre>
        </blockquote>
      </blockquote>
      <pre wrap="">
Yes it's a known problem - it's called "administrator didn't 
configure things right"
The workaround is to configure things right - see below !


</pre>
      <blockquote type="cite">
        <pre wrap="">Here is an example:
/etc/dhcp/dhcpd.conf
#dhcpd.conf
        ddns-update-style interim;
        shared-network DHCP{
                subnet 10.0.1.0 netmask 255.255.255.0 {
                range 10.0.1.1 10.0.1.253;
                option domain-name-servers 10.0.1.254;
                option routers 10.0.1.254;
                option subnet-mask 255.255.255.0;
                option broadcast-address 10.0.1.255;
                default-lease-time 86400;
                max-lease-time 86400;
                deny bootp;
        }}

ip a s eth2
2: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state 
DOWN qlen 1000
    link/ether 00:02:b6:36:d1:39 brd ff:ff:ff:ff:ff:ff
    inet 172.16.3.1/24 brd 172.16.3.255 scope global eth2
    inet 10.0.1.254/24 scope global eth2
</pre>
      </blockquote>
      <pre wrap="">
OK, eth2 is what we call a shared-network - it has two IP ranges on 
the same network (you appear to have realised that bit). What you 
need to do is define **ALL** subnets on that shared-network and group 
them in a shared-network statement like this :

shared-network DHCP{
   ... shared options
   subnet 10.0.1.0 netmask 255.255.255.0 {
     ... subnet options
   }
   subnet 172.16.3.0 netmask 255.255.255.0 {
     ... subnet options
   }
}

DHCPD will not work unless you correctly tell it about your network 
and it's topology. That means you accurately tell it about **all** 
subnets on **all** networks it will be servicing - you forgot to tell 
it about a subnet.

What I'm guessing is that you've assumed it will spot the other 
subnet at boot time, and since you don't want to declare anything in 
it, then you'll accept a default empty subnet. DHCPD doesn't do that 
- local subnets attached to local interfaces are effectively a 
special case, the general case is that a subnet may or may not be 
locally attached and for most operations it doesn't make any 
difference. For networks that aren't locally attached, the only 
information the server will have about it is what you put in the 
config file. It would have been something of a waste of effort to 
code auto-config of local subnets - especially since in most cases 
the admit would still need to declare them so as to configure options 
within them.

</pre>
    </blockquote>
    <font face="sans-serif">Thanks for the response. I got suckered
      because we ported code from FreeBSD 6.x <br>
      to Linux which generated the dhcpd.conf file and with dhcp 3.0 on
      FreeBSD this worked OK <br>
      without the additional subnet declarations. <br>
      <br>
      Anyway thanks for taking the time to reply.<br>
      <br>
      Regards,<br>
      <br>
    </font><br>
    <div class="moz-signature">-- <br>
      Stephen Clark<br>
      <b>NetWolves</b><br>
      Sr. Software Engineer III<br>
      Phone: 813-579-3200<br>
      Fax: 813-882-0209<br>
      Email: <a class="moz-txt-link-abbreviated" href="mailto:steve.clark@netwolves.com">steve.clark@netwolves.com</a><br>
      <a class="moz-txt-link-freetext" href="http://www.netwolves.com">http://www.netwolves.com</a><br>
    </div>
  </body>
</html>