Workbench WiFi

MikroTik DHCP Server Option 43

I often use MikroTik routers for DHCP, NAT, management VPN, and other tasks for the WLANs I manage. Utilizing DHCP Option 43 to provide Cisco APs with the IP address of the WLC(s) helps simplify the AP provisioning process. The MikroTik RouterOS configuration segment below is a glimpse of how I accomplish this.

The only potential gotcha is the format of the hex string value. Per the Cisco WLC documentation, the string always starts with 0xf1, followed by the length of the IP address lists expressed in number of octets. In this example, I have just one IP address for one WLC, so that number is 04 (one IPv4 address is made up of 4 octets). The remainder of the string, ac14640c, refers to the IP address 172.20.100.12, the WLC. A simple decimal to hex calculator can help with this conversion. Decimal 172 is hex ac, decimal 20 is hex 14, and so on. Note that single-digit values must be padded with a leading zero: decimal 12 is hex c, padded with a leading zero to become 0c.

/ip pool
add name="AP Management Pool" ranges=172.20.101.50-172.20.101.99

/ip dhcp-server option
add code=43 name=apmgmtopt43 value=0xf104ac100105

/ip dhcp-server network
add address=172.20.101.0/24 dhcp-option=apmgmtopt43 gateway=172.20.101.1

http://www.cisco.com/c/en/us/support/docs/wireless-mobility/wireless-lan-wlan/97066-dhcp-option-43-00.html
http://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server

Leave a Reply

Your email address will not be published. Required fields are marked *