конфиг длинка
Код: Выделить всё
create iproute default 192.168.50.254
config dhcp_relay add ipif System 10.10.10.7
config dhcp_relay option_82 state enable
enable dhcp_relay
Код: Выделить всё
config dhcp_relay add ipif System 10.10.10.7
Код: Выделить всё
authoritative;
ddns-update-style none;
default-lease-time 86400;
max-lease-time 90000;
log-facility local7;
local-address 10.10.10.7;
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 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));
log(info, concat("- Lease: ", binary-to-ascii(10, 8, ".", leased-address), " via IP: ", switch-addr, " (MAC: ", switch-mac, ") on port: ", switch-port, " in VLAN: ", switch-port-vlan));
}
subnet 10.10.10.0 netmask 255.255.255.0 {
range 10.10.10.20 10.10.10.40;
allow unknown-clients;
}
subnet 192.168.50.0 netmask 255.255.255.0 {
option routers 192.168.50.254;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.10.10.7;
class "13" {
match if (binary-to-ascii(16,8,":",substring(option agent.remote-id,2,6))="00:22:b0:51:26:8d" and binary-to-ascii(10,8,"",suffix(option agent.circuit-id,1))="13");
}
pool {
range 192.168.50.155;
allow members of "13";
}
}