{"id":1117,"date":"2014-12-17T22:18:11","date_gmt":"2014-12-17T14:18:11","guid":{"rendered":"https:\/\/ros.tw\/wp\/?p=1117"},"modified":"2014-12-17T22:18:11","modified_gmt":"2014-12-17T14:18:11","slug":"mikrotik-dhcp-option-43-how-to","status":"publish","type":"post","link":"https:\/\/ros.tw\/wp\/?p=1117","title":{"rendered":"Mikrotik DHCP option 43 How to"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<div class=\"lia-message-heading lia-component-message-header\">\n<div class=\"lia-quilt-row lia-quilt-row-standard\">\n<div class=\"lia-quilt-column lia-quilt-column-20 lia-quilt-column-left\">\n<div class=\"lia-quilt-column-alley lia-quilt-column-alley-left\">\n<div class=\"lia-message-subject\">\n<h1>Mikrotik DHCP option 43 How to<\/h1>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"lia-quilt-column lia-quilt-column-04 lia-quilt-column-right\">\n<div class=\"lia-quilt-column-alley lia-quilt-column-alley-right\">\n<div class=\"lia-message-options\">\n<div id=\"actionMenuDropDown_0\" class=\"lia-menu-navigation-wrapper lia-menu-action message-menu\">\n<div class=\"lia-menu-navigation\">\n<div class=\"dropdown-default-item\"><a id=\"dropDownLink_0\" class=\"lia-js-menu-opener default-menu-option lia-js-mouseover-menu lia-link-navigation\" href=\"https:\/\/community.ubnt.com\/t5\/UniFi-Wireless\/Mikrotik-DHCP-option-43-How-to\/td-p\/259954#\">Options<\/a><\/p>\n<div class=\"dropdown-positioning\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"lia-message-dates lia-message-post-date lia-component-post-date-last-edited\"><span class=\"DateTime lia-message-posted-on lia-component-common-widget-date\"><span class=\"local-date\">\u200e04-12-2012<\/span> <span class=\"local-time\">03:48 PM<\/span><\/span><\/p>\n<div id=\"messagebodydisplay\" class=\"lia-message-body\">\n<div class=\"lia-message-body-content\">After doing a lot of searching, I could not find an easy guide on how to add the option 43 to DHCP on a Mikrotik and get my APs to connect to a remote Controller so I figured I would write one.<\/p>\n<p>My Setup:<br \/>\nMikrotik 750 (v5.4 os) (Default config)<br \/>\nUnifi 2.2 controller on ubuntu VMWARE guest (Public IP: 192.168.200.10)<\/p>\n<p>1. Convert your public IP to hex. The option 43 value has to be in HEX to work.<br \/>\n192=C0<br \/>\n168=A8<br \/>\n200=C8<br \/>\n10=0A<br \/>\n2. Your option 43 value will be &#8220;0x0104&#8221; + the HEX of the IP.<br \/>\nSo in my example it is: &#8220;0x0104C0A8C80A&#8221;<br \/>\n3. Open up a new terminal on your Mikrotik or ssh in and type:<br \/>\n\/ip dhcp-server option add code=43 name=unifi value=0x0104C0A8C80A<br \/>\n\/ip dhcp-server network set 0 dhcp-option=unifi<br \/>\nMy router was using the default config so only one network was present ID 0. You could do &#8220;\/ip dhcp-server network print&#8221; to see the list and pick the ID of the network you want to add the option to.<br \/>\n4. Plug in your UAP and it should grab the info and show up on the remote Unifi controller asking to be adopted.<\/p>\n<p><b>Troubleshooting:<\/b><br \/>\nOlder UAPs have older firmware. The older firmware does not ask DHCP for option 43. Pulled my hair out for a few hours on this one. The way I found this was by turning on DHCP logging and watched the DHCP Discover. It was not asking for &#8220;VendorSpecific&#8221; which is option 43. If you have these you have a few options.<br \/>\n1. Upgrade the firmware in the lab by connecting them to a local Controller, adopting them and then &#8220;paper-clip&#8221; them.<br \/>\n2. Use the discovery tool on them to make them connect.<br \/>\n3. Use DNS. I prefer not to use this method but it does work even on older firmware. In your DHCP server config put in a domain name that you control. Then add a unifi A record pointing to the remote unif controller. Some will say this is easier than Option 43. However if you are doing many different controllers you would have to setup lots of sub-domains and such. And that domain will be default domain name on any hosts connecting on that network.<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; Mikrotik DHCP option 43 Ho &hellip; <a href=\"https:\/\/ros.tw\/wp\/?p=1117\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1117","post","type-post","status-publish","format-standard","hentry","category-ros"],"_links":{"self":[{"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1117"}],"version-history":[{"count":1,"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1117\/revisions"}],"predecessor-version":[{"id":1118,"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1117\/revisions\/1118"}],"wp:attachment":[{"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ros.tw\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}