Tags
When I play with DHCP option-82 feature in WLC came across an option that I can set “AP-MAC:SSID” as remote id. Rather than rely on the debug output I wonder I could get the hex value of that remote-id. If you are good at “string to hex” conversion you can do that.
For an example, if your WLAN name is “data-13” then you can derive equivalent hex string should be “64 61 74 61 2d 31 33” for that SSID name. You can do the conversion by using following conversion table (Refer ASCII-DEC-HEX conversion table for full list).
Therefore if your AP Radio MAC address is “64a0e7af4740” the DHCP 82 remote ID string would be “64a0e7af47403a64 6174612d3133” in the format of <ap-radio-mac>:<ssid>
If you look at the “debug ip dhcp server class” you can confirm the above. As you aware DHCP relay information consist of <circuit-id><agent-type><remote-id-length><remote-id> format. In the output below dhcp realay information is 010400000000022764a0e7af47403a646174612d313300000000000000000000000000000000000000000000000000.
As remote-id length is 39 (equivalnt to 27 in hex) bytes padding will be done with additional zero.
Here is the output of “debug ip dhcp server class” when the DHCP class configured properly with relay-information that consist of <ap-map>:<ssid> information.
*Mar 1 16:21:07.793: DHCPD: Class 'LAP1' matched by default *Mar 1 16:21:07.793: DHCPD: Searching for a match to 'relay-information 010400000000022764a0e7af47403a646174612d313300000000000000000000000000000000000000000000000000' in class LAP1 *Mar 1 16:21:12.206: DHCPD: Class 'LAP2' matched by default *Mar 1 16:21:12.206: DHCPD: Searching for a match to 'relay-information 010400000000022764a0e7af47403a646174612d313300000000000000000000000000000000000000000000000000' in class LAP2 *Mar 1 16:21:12.206: DHCPD: input pattern 'relay-information 010400000000022764a0e7af47403a646174612d313300000000000000000000000000000000000000000000000000' matches class LAP2 *Mar 1 16:21:12.206: DHCPD: input matches class LAP2
Let’s do another conversion. if you define your SSID as “mrn-cciew” then equivalent hex conversion of my SSID would be “6d726e2d6363696577”. If you configure this WLAN on the same WLC where LAP2 (with radio MAC 64a0e7af4740) your remote id option should start with “64a0e7af47403a6d726e2d6363696577” padding additional zeros to fill 39 byte field.
(WLC3) >config interface create vlan19 19 (WLC3) >config interface address dynamic-interface vlan19 192.168.19.30 255.255.255.0 192.168.19.1 (WLC3) >config interface dhcp dynamic-interface vlan19 primary 192.168.19.1 (WLC3) >config interface port vlan19 1 (WLC3) >config interface dhcp dynamic-interface vlan19 option-82 enable (WLC3) >config wlan create 12 mrn-cciew mrn-cciew (WLC3) >config wlan interface 12 vlan19 (WLC3) >config wlan security wpa disable 12 (WLC3) >config wlan enable 12 (WLC3) >config dhcp opt-82 remote-id apmac:ssid CAT4# *Mar 1 17:30:37.320: DHCPD: Class 'LAP2' matched by default *Mar 1 17:30:37.320: DHCPD: Searching for a match to 'relay-information 010400000000022764a0e7af47403a6d726e2d63636965770000000000000000000000000000000000000000000000' in class LAP2 *Mar 1 17:30:37.320: DHCPD: Class 'LAP1' matched by default *Mar 1 17:30:37.320: DHCPD: Searching for a match to 'relay-information 010400000000022764a0e7af47403a6d726e2d63636965770000000000000000000000000000000000000000000000' in class LAP1 *Mar 1 17:30:39.568: DHCPD: Class 'LAP2' matched by default *Mar 1 17:30:39.568: DHCPD: Searching for a match to 'relay-information 010400000000022764a0e7af47403a6d726e2d63636965770000000000000000000000000000000000000000000000' in class LAP2
Once you configure this string on your DHCP class you would see IP address allocated to client properly.
ip dhcp pool VLAN19
network 192.168.19.0 255.255.255.0
default-router 192.168.19.1
domain-name mrn.com
dns-server 192.168.200.1
class LAP2
address range 192.168.19.221 192.168.19.240
class LAP1
address range 192.168.19.121 192.168.19.140
ip dhcp class LAP2
relay agent information
relay-information hex 010400000000022764a0e7af47403a646174612d313300000000000000000000000000000000000000000000000000
relay-information hex 010400000000022764a0e7af47403a6d726e2d63636965770000000000000000000000000000000000000000000000
Once you configure the correct string you would see debug output like this & client get the IP
*Mar 1 17:38:44.426: DHCPD: Class 'LAP1' matched by default *Mar 1 17:38:44.426: DHCPD: Searching for a match to 'relay-information 010400000000022764a0e7af47403a6d726e2d63636965770000000000000000000000000000000000000000000000' in class LAP1 *Mar 1 17:38:48.881: DHCPD: Class 'LAP2' matched by default *Mar 1 17:38:48.881: DHCPD: Searching for a match to 'relay-information 010400000000022764a0e7af47403a6d726e2d63636965770000000000000000000000000000000000000000000000' in class LAP2 *Mar 1 17:38:48.889: DHCPD: input pattern 'relay-information 010400000000022764a0e7af47403a6d726e2d63636965770000000000000000000000000000000000000000000000' matches class LAP2 *Mar 1 17:38:48.889: DHCPD: input matches class LAP2 CAT4#sh ip dhcp binding Bindings from all pools not associated with VRF: IP address Client-ID/ Lease expiration Type Hardware address/ User name 192.168.19.222 0104.f7e4.ea5b.66 Mar 03 1993 04:39 AM Automatic
In this way you can different range of IP (in the same subnet) based on the client attachment to the network.
Related Posts
1. Understanding DHCP Option 82
2. WLC – DHCP Option 82 Configuration Example
Thank you very much for this post! Very well written, but I still can’t get my head wrapped around on how you determine the length of the remote-id… Why in your example it is 39 decimal (27 hex) and why is it the same for both remote-ids even though the length of the strings in hex, before padding with zeros for 2 of them are different? Thank you!
Hi Anna
Refer this post as well
https://mrncciew.com/2013/06/08/wlc-dhcp-option-82-config-example/
I think I have looked at the debug output & derive the remote-id length from that.
HTH
Rasika