alex_ov писал(а):
Но по DHCP Relay opt.82 (параметры свич+порт) сервер никак не может определить от кого идет запрос с этого порта - от компа, или от STB. Поэтому нет возможности разграничить выдачу белых/серых IP.
Код:
class "10-99-140-5:13:USER" { match if (substring(option agent.remote-id,2,32)="10.99.140.5" and binary-to-ascii(10,8,"",suffix(option agent.circuit-id,1))="13" and (not(substring(lcase(option vendor-class-identifier), 5, 6)="aminet")) and (not(substring(lcase(option vendor-class-identifier), 7, 3)="mag"))); }
class "10-99-140-5:13:AMINET" { match if (substring(option agent.remote-id,2,32)="10.99.140.5" and binary-to-ascii(10,8,"",suffix(option agent.circuit-id,1))="13" and (substring(lcase(option vendor-class-identifier), 5, 6)="aminet")); }
class "10-99-140-5:13:MAG" { match if (substring(option agent.remote-id,2,32)="10.99.140.5" and binary-to-ascii(10,8,"",suffix(option agent.circuit-id,1))="13" and (substring(lcase(option vendor-class-identifier), 7, 3)="mag")); }
Код:
# //user???? [???(tarif)] - 10.99.140.5:13
pool {
allow members of "10-99-140-5:13:USER";
range ??? ???;
}
pool {
allow members of "10-99-140-5:13:AMINET";
range ???;
}
pool {
allow members of "10-99-140-5:13:MAG";
range ???;
}

(для ISC-DHCP)
Минус такого решения в том, бОльшее количество классов замедляет рестарт сервера. Плюс в том, что коммутаторы дополнительно "допиливать" не нужно.