Страница 1 из 1

isc dhcp option 82

Добавлено: 2009-05-08 18:39:54
qwe
Здравствуйте.

Ребята, у кого есть опыт настройки isc dhcp для выдачи ip с анализом опции 82?

У меня возникла сложность следующего рода:

subnet 192.168.1.0 netmask 255.255.255.0 {
class "port-1" {
match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "1";
}
class "port-3" {
match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "3";
}
class "port-20" {
match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "20";
}

pool {
range 192.168.1.155;
allow members of "port-1";
}
pool {
range 192.168.1.133;
allow members of "port-3";
}
pool {
range 192.168.1.45;
allow members of "port-20";
}

В таком виде всё работает. Но здесь описано для одного свитча. А сеть 192.168.1/24 будет содержать несколько управляемых свитчей, передающих DHCP-запросы с option 82. Прочёл, что анализ MAC-адреса коммутатора производится следующим образом:
match if binary-to-ascii (16, 8, ":", suffix ( option agent.remote-id, 6)) = "00:15:60:79:28:00";

Но как теперь всё это воедино собрать? Есть ли у вас ваши работающие решения?

Спасибо.

Re: isc dhcp option 82

Добавлено: 2009-05-15 19:58:49
qwe
Разобрался. Вот рабочий конфиг.

Код: Выделить всё

option domain-name "test.domain";
option domain-name-servers 192.168.1.1;

default-lease-time 600;
max-lease-time 7200;
authoritative;
ddns-update-style none;
log-facility local7;

if exists agent.circuit-id
{

 log ( info, concat( "Lease for ", binary-to-ascii (10, 8, ".", leased-address),
 " raw option-82 info is CID: ", binary-to-ascii (10, 8, ".", option agent.circuit-id), " AID: ",
 binary-to-ascii(16, 8, ".", option agent.remote-id)));
}

subnet 192.168.1.0 netmask 255.255.255.0 {
    class "port-1" {
        match if binary-to-ascii (16, 8, ":", suffix ( option agent.remote-id, 6)) = "0:14:af:8f:9a:80" and binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "1";
    }
    class "port-3" {
        match if binary-to-ascii (16, 8, ":", suffix ( option agent.remote-id, 6)) = "0:15:60:79:28:00" and binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "3";
    }
    class "port-45" {
        match if binary-to-ascii (16, 8, ":", suffix ( option agent.remote-id, 6)) = "0:15:60:79:28:00" and binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1)) = "45";
    }

    pool {
        range 192.168.1.155;
        allow members of "port-1";
    }
    pool {
        range 192.168.1.133;
        allow members of "port-3";
    }
    pool {
        range 192.168.1.45;
        allow members of "port-45";
    }
}