Recently I installed a lot of new Unifi Sites in local Schools, due to Corona the demand of a working Wifi in School Environments boosted. Most sites we Setup run their Network split to different VLANs, so a simple Layer 2 Adoption is not always possible. But Unifi Controllers luckily have a way to solve this issue. So I got used to set Option 43 and DNS name on each site, no matter if VLAN (L3 Structure) or a flat L2 Network. I just set the Options and done.
Depending on what you use as DHCP Server Configuration of the “Vendor Specific Option” 43 is quite different. Most of them have in common that you first need to convert the Static IPv4 of your unifi Controller into a HEX Value. In Front of the HEX-Address we hat 01:04: this is for Suboption 01 and length 04:
I added a small Form and table to this Post to quickly give you a rough overview how to configure which DHCP. Just fill in your static IPv4 Controller Address. If any other DHCP Server is missing and you like me to add it let me know the Options.
|pfSense||Add Custom DHCP Option Number 43 with Type String||Number: |
|Sophos UTM||Net Services > DHCP > New DHCP Option||Name: |
|Mikrotik RouterOS via GUI||IP > DHCP Server > Click the "+" sign to create a new option||Name: |
|Mikrotik RouterOS via CLI||SSH or Terminal into your Mikrotik and type:|
|Cisco CLI||Create or modify a DHCP Pool. (help) Then add option:|
|Peplink Router||Go to DHCP Option 43 and enter those Values||Type: |
|Windows Server||Go to Scope Options and add Vendor Specific Info||Binary: |
|DNSMasq||Add this option to your pool config|
|ISC DHCP server (dhcpd.conf)||Linux ISC DHCP server via dhcpd.conf.||Add to your dhcpd.conf:|
Add to the subnet part, short example:
|Palo Alto||Add DHCP Option 43 (Pan OS 7.1)||Name: |
Vendor Class ID:
Secondary to the Option 43 I also add the hostname “unifi” into my local DNS Server pointing as A Record to my static IPv4 of the Unifi Controller. Don’t forget to also specify a domain if your DHCP Server sets a local domain. So if your local domain is “mylocal” add for Example:
Unifi in DNS
“unifi.mylocal A 192.168.1.2”
I indeed prefer to use both methods because depending on your local domain I already had some problems where the DNS only way didn't work as expected.
Screenshots Example pfSenseMost times we use pfSense as Router, DHCP and local DNS. As a quick Example here are some Screenshots how to configure DHCP 43 and DNS in a pfSense:
Services > DNS Resolver > General Settings > Host Override
Services > DHCP Server > Additional BOOTP/DHCP Options