Skip to main content

DHCP Server Option Matcher

MAC OUI

The following MAC OUI matching requires at least RouterOS 7.18.2. It leverages matching the MAC OUI via DHCP Option 61 (Client-ID) which is 0x01 followed by the client MAC address.

Testing environment

# configuration validation environment on test router

/ip pool
add name=dhcp_pool-lan-diag1 ranges=192.168.231.100-192.168.231.199
add name=dhcp_pool-lan-diag1-matcher-testing1 ranges=192.168.231.200-192.168.231.209

/ip dhcp-server network
add address=192.168.231.0/24 dns-server=192.168.231.1 domain=diag1.loc gateway=192.168.231.1

/ip dhcp-server
add address-pool=dhcp_pool-lan-diag1 interface=bridge-lan-diag1 lease-time=10m name=dhcp-lan-diag1
# matcher for OUI:F8:E4:3B (Anker USB-C adapter)
/ip dhcp-server matcher
add name=oui-match_Anker-F8E43B  \
    server=dhcp-lan-diag1 \
    address-pool=dhcp_pool-lan-diag1_matcher-testing1 \
    option-set=test-set-1 \
    code=61 \
    value=0x01f8e43b \
    matching-type=substring

Actual product matchers

The matchers below exclude the dhcp server, pool and other settings. You will need to tweak them as needed, but the code snippets below will at least load the OUI matchers into RouterOS for you.

# Polycom
/ip dhcp-server matcher
add name=oui-match_Poly-0004F2 matching-type=substring code=61 value=0x010004f2
add name=oui-match_Poly-64167F matching-type=substring code=61 value=0x0164167f

 

Vendor Class Ids

Below is a list of known vendor Class Ids that have been observed from DHCP requests.

Vendor Class Ids
Option 60 Content Vendor Notes
Algo 8301 Paging Adapter ALGO_VENDORamp; Scheduler

android-dhcp-9

CISCO SPA112 Cisco (Linksys) Analog adapter
Fanvil X6U-V2 Fanvil Vendor Class Id is not enable by default. Hostname matching is needed for out of the box use. The default hostname for this specific model would be "X6U-V2"
HT7XX dslforum.org Grandstream Analog adapter
MSFT 5.0

Polycom-VVX250 Polycom Just change the model number for other devices
TOSHIBA IPedge

ubnt

udhcp 0.9.8

udhcp 1.15.3

Mikrotik DHCP Server Option Matchers Configurations

# Polycom Vendor-Id / Class-Id matchers
:do { /ip dhcp-server option sets add name=voice-polycom } on-error={}
/ip dhcp-server matcher
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX101" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX101
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX250" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX250
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX300" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX300
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX310" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX310
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX311" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX311
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX410" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX410
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX411" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX411
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX500" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX500
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX501" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX501
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Polycom-VVX600" option-set=voice-polycom server=dhcp-lan value=Polycom-VVX600

# Fanvil Vendor-Id / Class-Id matchers
:do { /ip dhcp-server option sets add name=voice-fanvil } on-error={}
/ip dhcp-server matcher
add address-pool=dhcp_pool-lan-voice code=12 name="Hostname(12):X5U" option-set=voice-fanvil server=dhcp-lan value="X5U"
add address-pool=dhcp_pool-lan-voice code=12 name="Hostname(12):X5U-V2" option-set=voice-fanvil server=dhcp-lan value="X5U-V2"
add address-pool=dhcp_pool-lan-voice code=12 name="Hostname(12):X6U" option-set=voice-fanvil server=dhcp-lan value="X6U"
add address-pool=dhcp_pool-lan-voice code=12 name="Hostname(12):X6U-V2" option-set=voice-fanvil server=dhcp-lan value="X6U-V2"
add address-pool=dhcp_pool-lan-voice code=12 name="Hostname(12):X210" option-set=voice-fanvil server=dhcp-lan value="X210"
add address-pool=dhcp_pool-lan-voice code=12 name="Hostname(12):X210-V2" option-set=voice-fanvil server=dhcp-lan value="X210-V2"

add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Fanvil X5U" option-set=voice-fanvil server=dhcp-lan value="Fanvil X5U"
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Fanvil X5U-V2" option-set=voice-fanvil server=dhcp-lan value="Fanvil X5U-V2"
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Fanvil X6U" option-set=voice-fanvil server=dhcp-lan value="Fanvil X6U"
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Fanvil X6U-V2" option-set=voice-fanvil server=dhcp-lan value="Fanvil X6U-V2"
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Fanvil X210" option-set=voice-fanvil server=dhcp-lan value="Fanvil X210"
add address-pool=dhcp_pool-lan-voice code=60 name="Vendor Class Id (60):Fanvil X210-V2" option-set=voice-fanvil server=dhcp-lan value="Fanvil X210-V2"



# Need to add
# 2N IP Vario
# 2N IP Verso
# Axis A8105-E Network Video Door Station
# Axis A8207-VE Network Video Door Station
# Axis A8207-VE Mk II Network Video Door Station
# Axis C1310-E Network Horn Speaker
# Barix
# Cisco SPA112
# Cisco SPA303
# Cisco SPA525G2

-end