Wrong address assigned --- bottom bits of MAC address ignored ?

gary mazzaferro garym at oedata.com
Thu Feb 28 17:53:25 UTC 2013


Hi Glen,

Thanks... This was the explanation I was looking for.. again thank you

This should be in a practices guide, your description well written and
easily understood.

Both you and Sten were correct, hosts must not be placed in the subnet
declaration. The server does act weird, it won't serve fixed addresses
unless they are in the range. But, then its a first come basis for
assignment.

Now I have to figure out why the server is not seeing dhcp requests on eth2.

again thank you...

cheers,
gary


On Thu, Feb 28, 2013 at 6:56 AM, Glenn Satchell
<glenn.satchell at uniq.com.au> wrote:
> Hi Gary
>
> Just to clarify a few things.
>
> You have two ethernet interfaces and two subnets. Are these physically
> separate subnets, ie using different switches, or different vlans on one
> switch?
>
> Or are they sharing the same broadcast domain, with both subnets going
> over the same wire and traffic visible on both ports? In dhcpd this is
> termed a shared-network.
>
> This is important, because if it's a shared network the client may be
> sending all requests out eth0. This is the mac the server sees and it
> responds as you have seen.
>
> Is the second ethernet port being assigned any IP address?
>
> For a host statement with fixed-address the dhcp server takes some short
> cuts. One of these side effects is that it does not record an entry in the
> leases file. So the dhcpd.leases entry you see is for allocation from the
> dynamic range. Once the dhcp server has allocated an address to a client
> it will continue to offer the same address each time that client asks for
> it unless a different client is already using it.
>
> The dhcp server will not allocate a fixed-address if it puts the client in
> the wrong subnet. ie if the request came in via a relay or direct
> connection that indicated it was in a different subnet it would allocate
> one from the dynamic range of the appropriate subnet.
>
> Fourthly, if you put an address in the "range" then the server is able to
> allocate that address even if there is a host entry with fixed-address
> also using that same address. It is a race to see who gets it first. Even
> though the dhcp server will ping the address before offering it, if a
> firewall on the client (common on windows since XP) blocks icmp then it
> will not receive a response. So fixed-addresses should not be included in
> range statements.
>
> In this case you want
>
> range 172.31.1.17 172.31.1.30;
> and
> range 10.96.165.17 10.96.165.44;
>
> The dhcp server thinks 90:e2:ba:0c:0d:50 is connected to the 172.31.1.0
> subnet and offers a dynamic IP from the range in that subnet. It's just a
> coincidence that it chose 172.31.1.16, perhaps that was the first free
> address. Now that it is in the dhcpd.leases file it will keep offering
> that address. To clear that lease entry, stop the dhcp server process,
> edit the dhcpd.leases file and remove all leases for that ip address
> (there may be several entries in the file) and then start the dhcpd
> process.
>
> As others have said putting host statements in the subnet definition
> almost never does what you want, and causes confusion when clients receive
> odd responses. You are very strongly encouraged to move them out of the
> subnet definition. A simple comment will serve much better at documenting
> the desired information.
>
> Please keep posting responses and more questions. The dhcp server is a
> very flexible piece of software, so sometimes it takes a bit of tweaking
> to do what you want. The important part you need to do is describe your
> network topology to us - then we can help with how the config should go.
>
> regards,
> -glenn
>
>
> On Thu, February 28, 2013 11:15 pm, Sten Carlsen wrote:
>>
>> On 28/02/13 13:00, gary mazzaferro wrote:
>>> Hi Sten,
>>>
>>> Thank you for the reply and the explanation...
>>>
>>> I do understand host statements are global. Placing them under the
>>> subnets was for documentation than anything else.
>>>
>>> The explanation doesn't address the issue I'm experiencing, IP address
>>> for 172.31.1.16 is already provisioned for mac address
>>> 90:e2:ba:0c:0d:51 and in my reading of the documentation, the server
>>> should not be offering to the incoming request using mac address
>>> 90:e2:ba:0c:0d:50.
>> Well, this is probably another misunderstanding, if I understand you
>> correctly. Putting a fixed address into a host statement does NOT
>> reserve it for any purpose. The server will happily hand it out to any
>> who may ask IF it is in the pool/range of the subnet the discover
>> arrives at.
>> My guess is that your eth1 has an address in the 172.31.1.x range - this
>> would mean that it will get an address in that range (or no addresss at
>> all) whatever you put in the host statement.
>>
>> Again I will warn against putting host statements in the subnets, in
>> this case it will mean that the following options will be given even
>> when the address is:
>>
>> Feb 27 18:07:54 DCAPXEserver dhcpd: DHCPACK on 172.31.1.16 to
>> 90:e2:ba:0c:0d:50 (hd-node4) via eth1
>>
>>   option domain-name "wbu.mydomain.com";
>>   option domain-name-servers 10.96.191.251,10.119.248.254;
>>   option routers 10.96.164.1;
>>   default-lease-time 3456000;
>>   max-lease-time 34560000;
>>
>> Basic point is DON'T put fixed address statements in the range you give
>> the server to hand out, there will not be any reservations made. Sorry I
>> missed this at first reading.
>>>
>>> cheers,
>>> gary
>>>
>>> On Wed, Feb 27, 2013 at 7:36 PM, Sten Carlsen <stenc at s-carlsen.dk>
>>> wrote:
>>>> It seems that you think the host statement can have a limited scope,
>>>> limited
>>>> to a subnet. That is not correct, host statements are global wherever
>>>> they
>>>> are placed. The bad thing about putting them into subnets is that they
>>>> will
>>>> inherit options from the subnet even if they get addresses from another
>>>> subnet.
>>>>
>>>> The server will hand out an address corresponding to the subnet it sees
>>>> the
>>>> discover coming from, it will use the fixed address only if it matches
>>>> the
>>>> subnet the discover comes from, else it will use an address from the
>>>> subnet's pool.
>>>>
>>>>
>>>>
>>>> On 28/02/13 2:36, gary mazzaferro wrote:
>>>>
>>>> Hi,
>>>>
>>>> Maybe someone can help me..
>>>>
>>>> I have an intel card with 4 ports.. with incremental  mac addresses.
>>>>
>>>> I'm trying to to use the dhcp server 4.2.3.P2 to assign two subnets
>>>> based on mac addresses, The server is assigning the first address it
>>>> finds close to the mac address.  Not sure if my config file is bad..
>>>>
>>>> 90:e2:ba:0c:0d:50 should be 10.96.165.16
>>>> 90:e2:ba:0c:0d:51 should be 172.31.1.16
>>>>
>>>> 90:e2:ba:0c:0d:50 sees and offer of 172.31.1.16
>>>>
>>>> Feb 27 18:07:53 DCAPXEserver dhcpd: DHCPDISCOVER from 90:e2:ba:0c:0d:50
>>>> via
>>>> eth1
>>>> Feb 27 18:07:54 DCAPXEserver dhcpd: DHCPOFFER on 172.31.1.16 to
>>>> 90:e2:ba:0c:0d:50 (hd-node4) via eth1
>>>> Feb 27 18:07:54 DCAPXEserver dhcpd: DHCPREQUEST for 172.31.1.16
>>>> (172.31.1.10) from 90:e2:ba:0c:0d:50 (hd-node4) via eth1
>>>> Feb 27 18:07:54 DCAPXEserver dhcpd: DHCPACK on 172.31.1.16 to
>>>> 90:e2:ba:0c:0d:50 (hd-node4) via eth1
>>>>
>>>> Can some one please help me ?
>>>>
>>>> lease file:
>>>> # The format of this file is documented in the dhcpd.leases(5) manual
>>>> page.
>>>> # This lease file was written by isc-dhcp-4.2.3-P2
>>>>
>>>> server-duid "\000\001\000\001\030\224\215R\000\014)\375\317\242";
>>>>
>>>> lease 172.31.1.16 {
>>>>   starts 4 2013/02/28 01:07:54;
>>>>   ends 2 2013/04/09 01:07:54;
>>>>   cltt 4 2013/02/28 01:07:54;
>>>>   binding state active;
>>>>   next binding state free;
>>>>   rewind binding state free;
>>>>   hardware ethernet 90:e2:ba:0c:0d:50;
>>>>   client-hostname "hd-node4";
>>>> }
>>>>
>>>> option domain-name-servers 172.31.1.10;
>>>> default-lease-time 3456000;
>>>> ddns-update-style none;
>>>> authoratative ;
>>>> subnet 172.31.1.0 netmask 255.255.255.0 {
>>>>   option domain-name "dca.wbu.mydomain.com";
>>>>   option domain-name-servers 172.31.1.10;
>>>>   option routers 172.31.1.1;
>>>>   default-lease-time 3456000;
>>>>   max-lease-time 34560000;
>>>>   range 172.31.1.11 172.31.1.30;
>>>>   host hd-namenode-data1 {
>>>>     option host-name "hd-namenode";
>>>>     hardware ethernet 00:0c:29:c6:82:be;
>>>>     filename "vmunix.hd-namenode";
>>>>     fixed-address 172.31.1.11;
>>>>   }
>>>>   host pikespeak1 {
>>>>     hardware ethernet 00:00:c0:5d:bd:95;
>>>>     filename "vmunix.pikepeak";
>>>>     server-name "pikespeak1";
>>>>   }
>>>>   host node1-data1 {
>>>>     option host-name "hd-node1";
>>>>     hardware ethernet 00:0c:29:c1:6e:35;
>>>>     filename "vmunix.stargo";
>>>>     fixed-address 172.31.1.13;
>>>>   }
>>>>   host node2-data1 {
>>>>     option host-name "hd-node2";
>>>>     hardware ethernet 00:0c:29:b8:af:f3;
>>>>     filename "vmunix.stargo";
>>>>     fixed-address 172.31.1.14;
>>>>   }
>>>>   host node3-data1 {
>>>>     option host-name "hd-node3";
>>>>     hardware ethernet 00:0c:29:04:65:ee;
>>>>     filename "vmunix.stargo";
>>>>     fixed-address 172.31.1.15;
>>>>   }
>>>>   host node4-data1-stargo {
>>>>     option host-name "hd-node4";
>>>>     hardware ethernet 90:e2:ba:0c:0d:51;
>>>>     filename "vmunix.stargo";
>>>>     fixed-address 172.31.1.16;
>>>>   }
>>>> }
>>>> subnet 10.96.165.0 netmask 255.255.255.0 {
>>>>   option domain-name "wbu.mydomain.com
>>>> ";
>>>>   option domain-name-servers 10.96.191.251,10.119.248.254;
>>>>   option routers 10.96.164.1;
>>>>   default-lease-time 3456000;
>>>>   max-lease-time 34560000;
>>>>   range 10.96.165.11 10.96.165.44;
>>>>   host hd-namenode-mgt {
>>>>     option host-name "hd-namenode";
>>>>     hardware ethernet 00:0c:29:c6:82:b4;
>>>>     filename "vmunix.hd-namenode";
>>>>     fixed-address 10.96.165.11;
>>>>   }
>>>>   host hd-node1-mgt {
>>>>     option host-name "hd-node1";
>>>>     hardware ethernet 00:0c:29:c1:6e:2b;
>>>>     filename "vmunix.hd-node1";
>>>>     fixed-address 10.96.165.13;
>>>>   }
>>>>   host hd-node2-mgt {
>>>>     option host-name "hd-node2";
>>>>     hardware ethernet 00:0c:29:b8:af:9e;
>>>>     filename "vmunix.hd-node2";
>>>>     fixed-address 10.96.165.14;
>>>>   }
>>>>   host hd-node3-mgt {
>>>>     option host-name "hd-node3";
>>>>     hardware ethernet 00:0c:29:04:65:e4;
>>>>     filename "vmunix.hd-node3";
>>>>     fixed-address 10.96.165.15;
>>>>   }
>>>>   host hd-node4-mgt-stargo {
>>>>     option host-name "hd-node4";
>>>>     hardware ethernet 90:e2:ba:0c:0d:50;
>>>>     filename "vmunix.hd-node4";
>>>>     fixed-address 10.96.165.16;
>>>>   }
>>>> }
>>>> _______________________________________________
>>>> dhcp-users mailing list
>>>> dhcp-users at lists.isc.org
>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>>>
>>>>
>>>> --
>>>> Best regards
>>>>
>>>> Sten Carlsen
>>>>
>>>> No improvements come from shouting:
>>>>        "MALE BOVINE MANURE!!!"
>>>>
>>>>
>>>> _______________________________________________
>>>> dhcp-users mailing list
>>>> dhcp-users at lists.isc.org
>>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>> _______________________________________________
>>> dhcp-users mailing list
>>> dhcp-users at lists.isc.org
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>>
>> --
>> Best regards
>>
>> Sten Carlsen
>>
>> No improvements come from shouting:
>>        "MALE BOVINE MANURE!!!"
>>
>> _______________________________________________
>> dhcp-users mailing list
>> dhcp-users at lists.isc.org
>> https://lists.isc.org/mailman/listinfo/dhcp-users
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users


More information about the dhcp-users mailing list