Step by step instructions to get DHCP Option 43 working on Mikrotik RouterOS 6.x
Many consumer devices allow you to pass configuration parameters like auto provisioning servers and such via dhcp. DHCP option 43 is used by Yealink, Ubiquiti and Ruckus as well as many others.
My need was to use it to send the address of the provisioning server to a number of Yealink T23G IP phones to make deployment easier.
I will assume that you already have the Mikrotik Router up and running, and that you have connected to it using Winbox. You also need to make sure that you have the DHCP package installed. In my examples I will show each step using the GUI as well as using terminal commands to achieve the same result.
Step 1: Add an IP Address in the IP range that you will be serving DHCP
Step 2:Set up the DHCP server
2. Click on DHCP Setup, and select the interface that you want the server running on:
/ip dhcp-server network add address=192.168.50.0/24 dns-server=184.108.40.206 gateway=192.168.50.1
Step 3: Adding DHCP Options
1. On the DHCP Server go to the “Options” tab and click on the “+” button:
3. Fill in the appropriate parameters for your system, in my case I wanted to supply Yealink IP Phones with the address for the provisioning server:
The name field can be anything to help you identify the value easily
The Yealink phones use DHCP option 43 to request the address of the provisioning server
Value: ‘IP and path of provisioning server’
Note the single quotes around the value, this tells Mikrotik that it is a string value, and is very important!
The Mikrotik Wiki supplies the following information regarding DHCP value types vir ROS 6.8+:
- 0xXXXX – hex string (works also in v5)
- ‘XXXXX’ – string (works also in v5 but without ‘ ‘ around the text)
- $(XXXXX) – variable (currently there are no variables for server)
- ‘10.10.10.10’ – IP address
- s’10.10.10.10′ – IP address converted to string
- ’10’ – decimal number
- s’10’ – decimal number converted to string
ip dhcp-server network set dhcp-option=yealink-prov-srv numbers=0
Source: Mikrotik DHCP Option 43 Tutorial