This article describes the logic between the BSSID (Basic Service Set Identifier) and corresponding radio's MAC address.
Table of Contents
An access point uses multiple MAC addresses for layer 2 communication on the different interfaces. The MAC address of a wireless interface is called the Basic Service Set Identifier (BSSID). A wireless access point needs a way to dynamically create those BSSIDs as it can have different numbers of SSIDs. In general, each radio and network interface has a globally unique MAC address programmed when the AP leaves the factory. The MAC Address rule (including Ethernet, if it has any) is as follows:
For Gen 3: UAP-nanoHD, UAP-IW-HD, UAP-FlexHD, UDM, and UAP-BeaconHD
- The default MAC ID (found on the back of the AP) is reserved for ethernet. If the model doesn’t have an ethernet port, such as UAP-BeaconHD, it is still reserved for this purpose.
- The 6th byte (counting from right to left) of the default MAC ID indicates the base MAC address of each radio for deriving the BSSID. The base MAC address is derived as follows:
- 2.4G radio (raX) - 6th byte + 1
- 5G radio (raiX) - 6th byte + 2
- Software uses that base MAC address to derive the BSSID (by changing the 3rd byte) by using the following logic for each radio:
- Every subsequent SSID sets the U/L bit (bit 1 of the first octet) to 1, indicating a locally administered MAC address.
- In addition, the 3rd byte is determined by the following rule:
MacMSK = b’10001111
3rd byte of (rai0 or ra0) = 3rd bytes of original MAC ID
3rd byte of (raiX or raX, X is non-zero) = (3rd bytes of original MAC ID & MacMSK) + (X << 4). (Where "&" stands for a logical "AND".)
For example, for an an access point like the one in the image to the left, with a MAC ID of 78:8a:20:df:88:70 and four SSIDs: SSID1, SSID2, SSID3, SSID4 (SSID1-2 is for 2.4G, SSID3-4 is for 5G) would use the following mapping:
SSID1: 78:8a:20:df:88:71 (2.4G, ra0, 0xdf = original 3rd byte of MAC ID)
Note that this MAC address (78:8a:20:df:88:71) is the MAC of the radio broadcasting SSID1 (and so on and so forth for the other SSIDs), and does not correspond to the MAC address of the wired ethernet port (which is 78:8a:20:df:88:70 in this example case)
For Gen 1, Gen 2, Gen 3 UAPs
Excluding Gen 1 UAP-AC and UAP-AC-Outdoor and Gen 3 UAP-nanoHD, UAP-IW-HD, UAP-FlexHD, UDM, UAP- and BeaconHD)
- The first SSID uses the default hardware MAC of the radio
- Every subsequent SSID sets the U/L bit (bit 1 of the first octet) to 1, indicating a locally administered MAC address. In addition, it increments the most-significant 4 bits of the first octet by (SSID index - 2).
For example, an AP with MAC address 80:2a:a8:17:74:b5 and four SSIDs: SSID1, SSID2, SSID3, SSID4 would use the following mapping:
Note that this MAC address, 80:2a:a8:17:74:b5, is the MAC of the radio broadcasting those SSIDs, and does not correspond to the MAC address of the wired ethernet port. The ethernet port is usually close by (i.e. modification of one of the octets by 1 or 2, depending on the number of radios), but it is not defined which octet gets modified.
How to Find Mapping in the UniFi Network Application
1. Navigate to the UniFi Devices section.
2. Click on the AP of your choice to reveal the AP's properties panel.
3. In the properties panel, within the Details tab check out the WLANS section. There is a BSSID column where this information is available.
Please note that this is a basic example of a network with one wireless network.