Multilple leases with same client identifier

Christian Kratzer ck-lists at cksoft.de
Thu Oct 25 11:52:11 UTC 2012


Hi,

On Thu, 25 Oct 2012, Simon Hobson wrote:

> Christian Kratzer wrote:
>
>> We have one specific device that sends identical ethernet addresses and uid 
>> for all the requests the different vlans.
>> 
>> When the device requests 3 leases one for each vlan it is on. The DHCP 
>> server releases the previously assigned leases as it assumes that the 
>> device has moved to a another network.
>
> That's not default behaviour - do you have (IIRC) one-lease-per-client turned 
> on ?

no.  I even explicitly disabled one-lease-per-client.

Tracing the code shows that the other leases or relasesed in find_lease() when called from ack_lease()

3472                 if (uid_lease -> subnet -> shared_network != share) {
3473 #if defined (DEBUG_FIND_LEASE)
3474                         log_info ("wrong network segment: %s",
3475                                   piaddr (uid_lease -> ip_addr));
3476 #endif
3477                         goto n_uid;
3478                 }
3479 
3480                 if ((uid_lease -> pool -> prohibit_list &&
3481                      permitted (packet, uid_lease -> pool -> prohibit_list)) ||
3482                     (uid_lease -> pool -> permit_list &&
3483                      !permitted (packet, uid_lease -> pool -> permit_list))) {
3484 #if defined (DEBUG_FIND_LEASE)
3485                         log_info ("not permitted: %s",
3486                                   piaddr (uid_lease -> ip_addr));
3487 #endif
3488                        n_uid:
3489                         if (uid_lease -> n_uid)
3490                                 lease_reference (&next,
3491                                                  uid_lease -> n_uid, MDL);
3492                         if (!packet -> raw -> ciaddr.s_addr)
3493                                 release_lease (uid_lease, packet);
3494                         lease_dereference (&uid_lease, MDL);
3495                         if (next) {
3496                                 lease_reference (&uid_lease, next, MDL);
3497                                 lease_dereference (&next, MDL);
3498                         }
3499                         continue;
3500                 }
3501                 break;

with DEBUG_FIND_LEASE activated dhcpd logs wrong_network_semgment for the other leases it finds and releases them at line 3494.


I have 3 leases like the follwing for the cpe:

 	lease 10.10.40.8 {
 	  starts 3 2012/10/24 19:49:26;
 	  ends 4 2012/10/25 03:49:26;
 	  cltt 3 2012/10/24 19:49:26;
 	  binding state active;
 	  next binding state free;
 	  rewind binding state free;
 	  hardware ethernet 00:0f:5d:a5:bd:10;
 	  uid "\001\000\017]\245\275\020";
 	  option agent.circuit-id "TESTKUNDE-004";
 	  option agent.remote-id 1:9:74:6b:30:31:2d:72:74:30:32;
 	  client-hostname "drg700";
 	}
 	lease 10.20.32.6 {
 	  starts 3 2012/10/24 19:49:27;
 	  ends 4 2012/10/25 03:49:27;
 	  cltt 3 2012/10/24 19:49:27;
 	  binding state active;
 	  next binding state free;
 	  rewind binding state free;
 	  hardware ethernet 00:0f:5d:a5:bd:10;
 	  uid "\001\000\017]\245\275\020";
 	  option agent.circuit-id "TESTKUNDE-004";
 	  option agent.remote-id 1:9:74:6b:30:31:2d:72:74:30:32;
 	  client-hostname "drg700";
 	}
 	lease 192.0.2.244 {
 	  starts 3 2012/10/24 19:49:27;
 	  ends 4 2012/10/25 03:49:27;
 	  cltt 3 2012/10/24 19:49:27;
 	  binding state active;
 	  next binding state free;
 	  rewind binding state free;
 	  hardware ethernet 00:0f:5d:a5:bd:10;
 	  uid "\001\000\017]\245\275\020";
 	  option agent.circuit-id "TESTKUNDE-004";
 	  option agent.remote-id 1:9:74:6b:30:31:2d:72:74:30:32;
 	  client-hostname "drg700";
 	}

all from different networks.  All but the last of them always got deleted immediately after creation.

I have patched find_lease() so at not to lookup the client identifier.

The effect is that now all leases remain valid for this box.

> AFAIK it's valid to use the same MAC address and ClientID on multiple VLANs - 
> if you think about it, if it is just different VLANs then the ethernet 
> interface is the same (so same MAC) and there's no reason for the ClientID to 
> vary.

it seems there is code in find_lease() to enforce something similar to
one_lease_per_client on a default basis.

Greetings
Christian

-- 
Christian Kratzer                      CK Software GmbH
Email:   ck at cksoft.de                  Wildberger Weg 24/2
Phone:   +49 7032 893 997 - 0          D-71126 Gaeufelden
Fax:     +49 7032 893 997 - 9          HRB 245288, Amtsgericht Stuttgart
Web:     http://www.cksoft.de/         Geschaeftsfuehrer: Christian Kratzer


More information about the dhcp-users mailing list