Jump to content
Калькуляторы

isc-dhcpd, интересное поведение. любопытство.

Добавил пару строк в dhcpd.conf

on commit {
set IPCLIENT = binary-to-ascii(10,8,".",leased-address);
set macAddressCli = binary-to-ascii(16,8,":",substring(hardware,1,6));
set PORTCLIENT = binary-to-ascii(10,8,"",suffix(option agent.circuit-id,1));
set VLAN = binary-to-ascii(10, 16,"",substring(option agent.circuit-id, 2, 2));
       execute("/testdhcpd.sh", "commit", IPCLIENT, macAddressCli, PORTCLIENT, VLAN);
       #execute("/testdhcpd.sh", "commit", IP, macAddress, PORT, VLAN);
}
on release {

set clientIP = binary-to-ascii(10, 8, ".", leased-address);
set clientMAC = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
       execute("/testdhcpd.sh", "release", ClientIP, ClientMAC);
}
on expiry {

set clientIP = binary-to-ascii(10, 8, ".", leased-address);
if(exists agent.remote-id) {
set clientMAC = binary-to-ascii(16, 8, ":", substring(option agent.remote-id, 2, 6));
execute("/testdhcpd.sh", "expiry", clientIP, clientMAC);
} else {
execute("/testdhcpd.sh", "expiry", clientIP);
}
}

 

текст скрипта совсем прост:

#!/bin/sh

test=$@

echo "$test" >> /tmp/testdhcp.log

 

Получаю:

commit 192.168.22.14 0:e:a6:9d:14:cf 4 1101
commit 192.168.21.105 0:18:f3:86:8b:bc 5 1030
commit 192.168.51.137 0:23:5a:5a:cb:7b 11 2185
commit 192.168.21.105 0:18:f3:86:8b:bc 5 1030
commit 192.168.51.137 0:23:5a:5a:cb:7b 11 2185
commit 192.168.51.137 0:23:5a:5a:cb:7b 11 2185
commit 192.168.51.137 0:23:5a:5a:cb:7b 11 2185
commit 192.168.51.137 0:23:5a:5a:cb:7b 11 2185
commit 192.168.51.137 0:23:5a:5a:cb:7b 11 2185
commit 192.168.21.31 0:25:22:b9:d5:e2 1 1023
commit 192.168.21.58 bc:ae:c5:b3:38:37 8 1025
commit 192.168.21.58 bc:ae:c5:b3:38:37 8 1025
commit 192.168.21.58 bc:ae:c5:b3:38:37 8 1025
commit 192.168.21.58 bc:ae:c5:b3:38:37 8 1025
commit 192.168.22.16 0:30:67:17:c0:54 6 1101
commit 192.168.22.48 54:4:a6:7e:78:a5 8 1102
commit 192.168.21.111 0:8:54:a9:e9:9 1 1031
commit 192.168.21.111 0:8:54:a9:e9:9 1 1031
commit 192.168.21.102 c0:c1:c0:7a:45:ac 2 1030
commit 192.168.21.164 44:87:fc:6c:69:17 4 1036
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.4.83 10:1f:74:b6:b7:52 3 2035
commit 192.168.22.47 0:24:54:dc:77:2f 7 1102
commit 192.168.22.47 0:24:54:dc:77:2f 7 1102
commit 192.168.22.45 1c:7e:e5:45:e6:5a 5 1102
commit 192.168.21.111 0:8:54:a9:e9:9 1 1031
commit 192.168.21.111 0:8:54:a9:e9:9 1 1031
commit 192.168.21.162 7c:67:4b:61:4:0 2 1036

 

И вот тут становится совсем интересно, что может являться причиной такого бесчисленного commit для определенных ip?

Юзается option82, dgs3120 перенаправляет на dhcp сервер, так самое интересно что в одних случаях все классно, а в других звиздец.

Share this post


Link to post
Share on other sites

Не знаю что значит коммит в этой хрени, но некоторые клиенты (обычно виндовые) относительно часто делают запрос DHCP-INFORM.

Share this post


Link to post
Share on other sites

ааа. вот теперь начинаю гореть.

выкопал. эта трабла с кучей дублей выползает именно там где пакеты реелятся свичом: DGS-3120-24SC Gigabit Ethernet Switch

только relay перекидываю на des3200-10 проблема отпадает. все клиенты мгновенно получают адреса и все впорядке. у меня шок. что делать? как искать проблему и кому сказать спасибо?

 

DGS-3120-24SC:admin#show dhcp_relay
Command: show dhcp_relay

DHCP/BOOTP Relay Status         : Enabled
DHCP/BOOTP Hops Count Limit     : 16
DHCP/BOOTP Relay Time Threshold : 0
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 : Keep
DHCP Relay Agent Information Option 82 Remote ID : Sib

Interface    Server 1        Server 2        Server 3        Server 4
------------ --------------- --------------- --------------- ---------------

Server           VLAN ID List
---------------  -----------------------------------------------------------
192.168.20.1    227,200-1150


DGS-3120-24SC:admin#

Share this post


Link to post
Share on other sites

http://forum.dlink.ru/viewtopic.php?f=2&t=154647

попросил знакомого поднять здесь

проблема явно есть, как только переносишь relay на другой свич, все летает.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.