Прошу прощения.
Почитал тему, поднятую здесь:
viewtopic.php?t=65790&postdays=0&postorder=asc&start=30
Пробовал разные настройки на роутере. В итоге сделал следующим образом:
на DGS-3627
Код:
create vlan test tag 2
create ipif test 10.1.2.254/24 vlan test state enable
vlan test - 1-22 порты нетэгированные.
в 1й порт подключил DHCP сервер, в другие - абонентов.
На роутере настроил:
Код:
DGS-3627:5#show dhcp_local_relay
Command: show dhcp_local_relay
DHCP/BOOTP Local Relay Status : Enabled
DHCP/BOOTP Local Relay VID List : 2
DGS-3627:5#show dhcp_relay
Command: show dhcp_relay
DHCP/Bootp Relay Status : Enabled
DHCP/Bootp Hops Count Limit : 4
DHCP/Bootp Relay Time Threshold : 0 second(s)
DHCP Vendor Class Identifier Option 60 State: Disabled
DHCP Client Identifier Option 61 State: Disabled
DHCP Relay Agent Information Option 82 State : Enabled
DHCP Relay Agent Information Option 82 Check : Disabled
DHCP Relay Agent Information Option 82 Policy : Replace
Interface Server 1 Server 2 Server 3 Server 4
------------ --------------- --------------- --------------- ---------------
Поменял конфиг dhcpd.conf:
Код:
####
class "port-17_3"
{
match if binary-to-ascii (10, 8, "", suffix( option agent.circuit-id, 1))="17"
and binary-to-ascii (16, 8, ":", substring(option agent.remote-id, 2, 6))="0:6:0:21:91:9f:e6:0";
}
pool {
range 10.1.2.100;
option routers 10.1.2.254;
option subnet-mask 255.255.255.0;
allow members of "port-17_3";
}
Ну тут как Вам угодно: или смотреть по МАК-адресу роутера, или по его айпишнику, предварительно указав айпи роутера в качестве agent.remote-id.
В результате в логе dhcp:
Код:
Aug 14 14:37:54 dhcp-server dhcpd: DHCPDISCOVER from 00:24:8c:4c:85:53 (nicolas-desktop) via em0
Aug 14 14:37:55 dhcp-server dhcpd: DHCPOFFER on 10.1.2.100 to 00:24:8c:4c:85:53 (nicolas-desktop) via em0
Aug 14 14:37:55 dhcp-server dhcpd: Lease for IP 10.1.2.100 is connected to interface/port 1/17 VLAN ID=2 on switch MAC=0:6:0:21:91:9f:e6:0