dhcpd.conf
log-facility local7;
allow unknown-clients;
default-lease-time 2400;
max-lease-time 1800;
authoritative;
#vlan3015
subnet 172.18.69.0 netmask 255.255.255.0 {
range 172.18.69.2 172.18.69.254;
interface vlan3015;
option routers 172.18.69.1;
option domain-name-servers 1.1.1.1;
}
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
set SwitchMac = "";
set SwitchPort ="";
if exists agent.circuit-id
{
set SwitchMac = binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6));
set SwitchPort = binary-to-ascii(10, 8, ":", suffix(option agent.circuit-id, 1));
}
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "commit",
ClientIP, ClientMac, SwitchMac, SwitchPort);
}
on expiry {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "expiry", ClientIP);
}
on release {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "release", ClientIP);
}
#vlan3038
subnet 172.18.92.0 netmask 255.255.255.0 {
range 172.18.92.2 172.18.92.254;
interface vlan3038;
option routers 172.18.92.1;
option domain-name-servers 1.1.1.1;
}
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
set SwitchMac = "";
set SwitchPort ="";
if exists agent.circuit-id
{
set SwitchMac = binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6));
set SwitchPort = binary-to-ascii(10, 8, ":", suffix(option agent.circuit-id, 1));
}
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "commit",
ClientIP, ClientMac, SwitchMac, SwitchPort);
}
on expiry {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "expiry", ClientIP);
}
on release {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "release", ClientIP);
}
#vlan3039
subnet 172.18.93.0 netmask 255.255.255.0 {
range 172.18.93.2 172.18.93.254;
interface vlan3039;
option routers 172.18.93.1;
option domain-name-servers 1.1.1.1;
}
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
set SwitchMac = "";
set SwitchPort ="";
if exists agent.circuit-id
{
set SwitchMac = binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6));
set SwitchPort = binary-to-ascii(10, 8, ":", suffix(option agent.circuit-id, 1));
}
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "commit",
ClientIP, ClientMac, SwitchMac, SwitchPort);
}
on expiry {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "expiry", ClientIP);
}
on release {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "release", ClientIP);
}
#vlan3040
subnet 172.18.94.0 netmask 255.255.255.0 {
range 172.18.94.2 172.18.94.254;
interface vlan3040;
option routers 172.18.94.1;
option domain-name-servers 1.1.1.1;
}
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
set SwitchMac = "";
set SwitchPort ="";
if exists agent.circuit-id
{
set SwitchMac = binary-to-ascii(16, 8, ":", suffix(option agent.remote-id, 6));
set SwitchPort = binary-to-ascii(10, 8, ":", suffix(option agent.circuit-id, 1));
}
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "commit",
ClientIP, ClientMac, SwitchMac, SwitchPort);
}
on expiry {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "expiry", ClientIP);
}
on release {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
execute("/usr/bin/perl", "/usr/local/nodeny/modules/dhcp/events.pl", "release", ClientIP);
}
Вот так оно у меня все настроено. Необходимо сделать так: виланы с 3001-3048 остаются на основном, а 2001-2048 обслуживаются сателитом. Реально ли это? В Dhcp конфиги описан каждый вилан.