<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello, Alexander.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
It's been a while since I've worked with this, but I believe your use of substring might be incorrect. I think the parameters should be indicating what position in the string to start matching and how many characters to match - your current substring is matching
two characters starting on the second position, but it appears that the system is reporting the agent-id as six characters - if that's true, then your agent-id value is starting on position three rather than position 2. I would give that a test.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
That said, my experiences with option-82 have been using a string, not a number, so my experiences may not apply.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Patrick</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> dhcp-users <dhcp-users-bounces@lists.isc.org> on behalf of Александр Сандецкий <alexander.sandetsky@gmail.com><br>
<b>Sent:</b> Friday, April 17, 2020 9:18 AM<br>
<b>To:</b> dhcp-users@lists.isc.org <dhcp-users@lists.isc.org><br>
<b>Subject:</b> Option 82 problem</font>
<div> </div>
</div>
<div>
<p>
<table width="800" border="1">
<tbody>
<tr bgcolor="#FFEB9C">
<td><font size="2"><strong>CAUTION:</strong> This email originated from outside of the company. Do not click links or open attachments unless you recognize the sender and know the content is safe.</font></td>
</tr>
</tbody>
</table>
</p>
<div>
<div dir="ltr">Hi!
<div><br>
</div>
<div>I have a problem with option 82 configuration.</div>
<div><br>
</div>
<div>I have managed switch with IP 10.10.0.38 (managed VLAN 100). There is additional VLANs configured for clients: VLAN 3000 and 3010. There is option 82 and DHCP relay configured on the switch.</div>
<div><br>
</div>
<div>I have DHCP server placed in VLAN 3000 with IP 172.18.0.101</div>
<div><br>
</div>
<div>I want to DHCP server serves the VLAN 3010 (and other) on per-VLAN basis.</div>
<div><br>
</div>
<div>The part of dhcpd.conf</div>
<div><br>
</div>
<div>class "VLAN3010" {<br>
match if binary-to-ascii(10, 8, "", substring(option agent.circuit-id, 2, 2)) = "3010"<br>
}<br>
<br>
<br>
subnet 172.18.10.0 netmask 255.255.255.0 {<br>
option routers 172.18.0.1;<br>
<br>
pool {<br>
range 172.18.10.51 172.18.10.250;<br>
allow members of "VLAN3010";<br>
}<br>
}</div>
<div><br>
</div>
<div><br>
</div>
<div>The server receives request as </div>
<div>DHCPDISCOVER from 2c:27:d7:b1:a2:85 via <a href="http://10.10.0.38">10.10.0.38</a>: network
<a href="http://10.10.0.0/24">10.10.0.0/24</a>: no free leases</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>I have checked with Wireshark</div>
<div><br>
</div>
<div> Option: (82) Agent Information Option<br>
Length: 18<br>
Option 82 Suboption: (1) Agent Circuit ID<br>
Length: 6<br>
Agent Circuit ID: 00040bc20003<br>
Option 82 Suboption: (2) Agent Remote ID<br>
Length: 8<br>
Agent Remote ID: 00068026897b2b40</div>
<div><br>
</div>
<div>There is binary encoded agent circuit id that contains "0bc2" bytes that equal to "3010" in decimal.</div>
<div><br>
</div>
<div>Why my class definition does not accept this request? What is wrong?</div>
<div><br>
</div>
<div><br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature">
<div><br>
</div>
<div>Regards,</div>
<div>Alexander </div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>