DHCP сервер какой?
Internet Systems Consortium DHCP Server?
Тогда вот самый примитивный пример куска из конфига:
Код:
authoritative;
ddns-update-style none;
# ddns-update-style ad-hoc;
default-lease-time 86400; # 24 hour
max-lease-time 86500; # 24 hour
min-lease-time 86000; # 24 hour
use-lease-addr-for-default-route on;
one-lease-per-client on;
deny duplicates;
deny bootp;
option arp-cache-timeout 3600;
option netbios-node-type 1; # B-node (Broadcast)
#-----------------------------------------------------------------------------
# специфичные для Microsoft-а вещи:
# DHCP Options Supported by Clients: http://support.microsoft.com/kb/121005
# How to disable NetBIOS over TCP/IP by using DHCP server options: http://support.microsoft.com/kb/313314
# DHCP Tools and Settings: http://technet2.microsoft.com/windowsserver/en/library/a70f1bb7-d2d4-49f0-96d6-4b7414ecfaae1033.mspx?mfr=true
option space microsoft;
option microsoft.disable-netbios-over-tcpip code 1 = unsigned integer 32;
option microsoft.release-on-shutdown code 2 = unsigned integer 32;
# только для Windows 2000 и XP клиентов используется:
# substring(option vendor-class-identifier, 0, 8) = "MSFT 5.0"
if substring(option vendor-class-identifier, 0, 4) = "MSFT" {
vendor-option-space microsoft;
# по дефолту NetBIOS over TCP/IP выключен! пример где включен см. ниже
option microsoft.disable-netbios-over-tcpip 2;
option microsoft.release-on-shutdown 1;
}
#-----------------------------------------------------------------------------
# Classless Static Route aka RFC 3442: http://www.ietf.org/rfc/rfc3442.txt
# Windows Vista и другие не Windows DHCP клиенты:
option classless-static-route code 121 = array of unsigned integer 8;
# Windows 2000 and XP DHCP клиенты:
option classless-static-route-ms code 249 = array of unsigned integer 8;
#-----------------------------------------------------------------------------
# логирование
log(info, concat("- Log anyway: ", binary-to-ascii(10, 8, ".", leased-address), " via IP: ", switch-addr, " (MAC: ", switch-mac, ") on port: ", switch-port, " in VLAN: ", switch-port-vlan, " Class Name: ",concat(binary-to-ascii(16,8,":",substring(option agent.remote-id,3,6)),":",binary-to-ascii(10,8,"",substring(option agent.circuit-id,5,1)))));
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, 16, "", substring(option agent.circuit-id, 2, 2));
option domain-name "mydomain.ru";
option domain-name-servers xx.xxx.xxx.xxx, yy.yyy.yyy.yy;
option subnet-mask 255.255.0.0;
# Адрес интерфейса, на который ДОЛЖНЫ приходить DHCP-запросы от клиентов
local-address 10.107.0.53;
......
subnet 10.0.0.0 netmask 255.0.0.0
{
.....
option routers 10.68.0.48;
class "17:9a:b:9f:ef:14"
{
match if concat(binary-to-ascii(16,8,":",substring(option agent.remote-id,3,6)),":",binary-to-ascii(10,8,"",substring(option agent.circuit-id,5,1))) = "17:9a:b:9f:ef:14"
}
pool
{
range 10.68.20.14;
allow members of "17:9a:b:9f:ef:14";
}
......
}
Данный кусок ВСЕГДА выдаст хосту, подключенному к 14-му порту железяки с MAC-адресом 00:17:9a:0b:9f:ef IP-адрес 10.68.20.14.
Прошу обратить внимание на то, что MAC-адрес 00:17:9a:
0b:9f:ef
, а binary-to-ascii(16,8,":",substring(option agent.remote-id,3,6)) = "17:9a:
b:9f:ef:14"
т.е. 0b => b
Конечно конфиг наверняка содержит че-нить "неправильное", зато 100% рабочий - если кто знает - поправьте.
Во всяком случае клиенты с всевозможными виндовозами, включая висту адреса получают. Линуксовые клиенты тоже. MAC OS не смогли раздобыть, но почему-то подозреваю, что там BSD-шный клиент, который так же железобетонно работает, как и линуксовый.