Wednesday, May 27, 2015

Mikrotik Dhcp Selection 43 Tutorial


Step past times pace instructions to larn DHCP Option 43 working on Mikrotik RouterOS 6.x

Many consumer devices permit you lot to move past times configuration parameters similar motorcar provisioning servers in addition to such via dhcp. DHCP selection 43 is used past times Yealink, Ubiquiti in addition to Ruckus as good as many others.

My involve was to purpose it to post the address of the provisioning server to a number of Yealink T23G IP phones to brand deployment easier.


I volition assume that you lot already accept the Mikrotik Router upwardly in addition to running, in addition to that you lot accept connected to it using Winbox. You too involve to brand certain that you lot accept the DHCP bundle installed. In my examples I volition present each pace using the GUI as good as using lastly commands to accomplish the same result.

Step 1: Add an IP Address inwards the IP make that you lot volition live serving DHCP


1. In Winbox, click on IP in addition to thus Addresses:

2. Click on "+" in addition to add together the appropriate IP details:
Code:
ip address add together address=192.168.50.1 interface=ether5

Step 2:Set upwardly the DHCP server

1. Click on IP in addition to thus DHCP Server:

2. Click on DHCP Setup, in addition to conduct the interface that you lot desire the server running on:

3. Click next, in addition to come inwards the subnet that the DHCP server volition serve, this volition live the same subnet of the IP you lot ready inwards pace 1:

4. Click adjacent in addition to come inwards the gateway for the network, virtually oft (but non always) this volition live the IP selected inwards pace 1:

5. Click adjacent in addition to come inwards the make of IP addresses that volition live issued past times this DHCP server. I unremarkably reserve the showtime xx IPs for static devices:

6. Click adjacent in addition to come inwards the IP for your DNS server(s):

7. Click adjacent in addition to come inwards the lease time, I unremarkably merely exit it as is.

8. Click adjacent in addition to Ok to consummate DHCP setup:
Code:
/ip dhcp-server add together address-pool=dhcp_pool1 disabled=no interface=ether5 name=dhcp1
/ip dhcp-server network add together address=192.168.50.0/24 dns-server=8.8.8.8 gateway=192.168.50.1

Step 3: Adding DHCP Options

1. On the DHCP Server larn to the "Options" tab in addition to click on the "+" button:

3. Fill inwards the appropriate parameters for your system, inwards my instance I wanted to render Yealink IP Phones amongst the address for the provisioning server:

Name: yealink-prov-srv
The elevate champaign tin laissez passer the sack live anything to aid you lot position the value easily
Code: 43
The Yealink phones purpose DHCP selection 43 to asking the address of the provisioning server
Value: 'IP in addition to path of provisioning server'
Note the unmarried quotes around the value, this tells Mikrotik that it is a string value, in addition to is rattling important!

The Mikrotik Wiki supplies the next information regarding DHCP value types vir ROS 6.8+:

  • 0xXXXX - hex string (works too inwards v5)
  • 'XXXXX' - string (works too inwards v5 but without ' ' around the text)
  • $(XXXXX) - variable (currently in that place 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
4. Go to the "Networks" tab of the DHCP Server window, in addition to double click the entry nosotros created earlier.

5. Under "DHCP Options" conduct the Option nosotros created before in addition to click OK to apply:


Code:
/ip dhcp-server selection add together code=43 name=yealink-prov-srv value="'192.168.1.10/yealink/'"
ip dhcp-server network laid dhcp-option=yealink-prov-srv numbers=0

That's it, if you lot reboot your phones, they should instantly larn the provisioning server via DHCP. This industrial plant as good for Ruckus in addition to Ubiquiti devices that brand purpose of DHCP to render the device amongst basic config data.