option 82. Change a MAC-address.

DHCP-User Nick dhcp at kld.ru
Wed Feb 27 09:55:04 UTC 2008


Hello.

I've a linux dhcpd with dhcpd.conf like this:

# dhcpd.conf
#

default-lease-time  1800;   # 1/2 hour
max-lease-time      3600;   # 1 hour
min-lease-time       900;   # 1/4 hour

one-lease-per-client true;

deny duplicates;
deny bootp;

option arp-cache-timeout 3600;
option netbios-node-type 1;

ddns-update-style none; ddns-updates off;

authoritative;


if exists agent.remote-id and exists agent.circuit-id {

     if binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)) = "0" {
         set switch-mac = concat("0", binary-to-ascii(16, 8, "", substring(option agent.remote-id, 2, 1)), ":", 
binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 3, 6)));
     } else {
         set switch-mac = binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6));
     }
     set client-mac  = binary-to-ascii(16, 8, ":", suffix(hardware,6));
     set switch-addr = binary-to-ascii(10, 8, ".", packet(24, 4));
     set switch-port = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 5, 1));
     set switch-port-vlan = binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 2, 2));
     set client-name = option host-name;
     log(info, concat("LEASE: ==", binary-to-ascii(10, 8, ".", leased-address), "==", client-mac, "==", switch-addr, 
"==", switch-mac, "==", switch-port, "==", switch-port-vlan, "==", client-name));
}

#################################


class "switch1" { match if substring(option agent.remote-id, 2, 6) = 00:2a:a1:4f:44:46 and binary-to-ascii(10, 8, "", 
substring(option agent.circuit-id,5, 1)) = "12"; }

subnet 10.1.25.0 netmask 255.255.255.0 {
   pool { option static-routes 10.0.0.10 10.1.25.1;
          range 10.1.25.254 10.1.25.254; allow members of "switch1";
         }

}

# end of config
-----------------------------------

I've connected a windows computer to 12 port of a switch. The computer have got an IP 10.1.25.254 by dhcp.
But! If i change a MAC of computer, the computer don't get the IP.
This is a log of DHCPD.

Feb 27 11:37:13 helper dhcpd: DHCPDISCOVER from 00:dd:dd:dd:dd:a1 via 172.25.254.1: network optic: no free leases

What I can do for quick release IP again? (Without checking a leases-file maybe?)

I've decreased a max-lease-time to 30sec. All work, but i've got a many requests. It's not good.
How I can set max-lease-time to 1day and quick release IP for request from other MAC-address?


Thanks.
nick














More information about the dhcp-users mailing list