-
-
Notifications
You must be signed in to change notification settings - Fork 627
in network tab, decode and id "Private MAC" addresses #3661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
|
I'm not sure what your goal here is.
You should have other means to figure out what you phone is, I guess. |
c0254d4 to
e9c3fdd
Compare
Goal is the same - to tell what device is what in the network tab - right now, I see things like:
which is great. But on a device which is using a private MAC address - make sure the user knows that the blank is on purpose, not a failure of the lookup mechanism. |
|
I don't think "Private MAC" is a good description. I think most users will ask "what does it mean Private MAC?" or similar questions. If the intention is to make clear that blank/empty is on purpose, we should use "N/A", or "(not available)", or simply leave it empty. |
|
There are a few different use cases:
The goal was to disambiguate 2 and 3 (since they are very different). I agree - maybe "Private MAC" isn't the most searchable term. Wikipedia and the RFC suggests "Locally administered" - that's likely the best term (as it shows up in the most searches)... |
technically - all EUI-48 identifiers all "real" - I'm just trying to tease apart:
Locally administered MAC addresses help explain a wide range of normal networking behavior that can otherwise can look confusing in Pi-hole’s UI. In modern networks, a device may reboot or a container may be recreated and come back with a new MAC, multiple virtual machines may share templates that generate related addresses, or Docker and Kubernetes workloads may appear and disappear as infrastructure scales. When Pi-hole shows these MACs without vendor information, users often assume something is broken - perhaps the lookup database is out of date, the device is unknown or suspicious, or Pi-hole failed to identify the client correctly. By detecting and labeling these as locally administered, Pi-hole makes it clear that the behavior is intentional and standards-compliant, not an error, and helps users understand why certain DHCP or group assignments change over time. The change is very small - checking a single standards-defined bit in the MAC address - and provides disproportionately large clarity and increases trust in the UI. As locally generated addresses are now extremely common across virtualization, container networking, software-defined networking, and privacy-protecting devices, this update helps Pi-hole better reflect the way real networks operate today. I get this is a little outside the scope of pi-hole. I'm OK if that is the conclusion - it was just an itch that I needed to scratch.. |
|
Updated UI to "Locally Administered" (with the url to Wikipedia.) If this is what people are looking for - the best thing would to do would be to add description of local addresses to : https://github.com/pi-hole/docs/tree/master/docs/guides/misc and point there, which I'm happy to do - but won't bother until others with approval rights say it's a good idea :) Thanks |
|
I agree with @rrobgill, we should not add a wikipedia link to each entry. Maybe a combination of 'N/A' as vendor + the tooltip with 'Locally administered'? |
|
Make sure to distinguish:
|
|
If a string is chosen to stand in place of the vendor identifier, would be better to set it in FTL? That way whatever string is chosen could be added directly to the network table in the same manner as entries from the manufacturer database rather than diverging what is presented to the user from what is stored in the database. Insert code It would execute once only, when the device is added to the network table, instead of in the browser every time the network page is rendered. All that the script would then need to handle would be any special formatting or mouseover tooltip (if implemented), in a similar manner as mock-MAC handling. eg: Also the current approach of looking at only bit 2 could report some misconfigured devices as being "Locally managed". The local devices as defined in 7042 has been updated by rfc9542. There are three active and one reserved ranges of locally administered addresses:
Devices with the multicast bit set (bit 1, any MAC with an odd number in the second hex digit) should likely not be identified as locally managed here, and probably neither should any devices in the reserved range. |
|
I'd like @DL6ER's thoughts on this subject, too. |
|
@rrobgill - thanks for pointers. Yes - RFC 9542 formally obsoletes RFC 7042 - that is totally correct, however, many modern OSes do not implement the Structured Local Address Plan (SLAP) that you correctly and accurately describe (yet). Examples: Few OSes implement the SLAP rules that I know of - They simply generate “random MAC with local bit set., copying the linux code. So ~25% of all such MACs end up in x6, which if you decode it according to 9542 - you get alot of "Reserved (Invalid Use)" labels... I did update things - it's still pretty trival, and did re-order and add multicast like you rightly suggested. |
fe3ea1a to
d820d0e
Compare
RFC 9542 replaces RFC 7042 and defines the Structured Local Address Plan (SLAP), subdividing the locally administered address space into four distinct quadrants: - Administratively Assigned (x2), - Reserved (x6), - Extended Local (xA), - and Standard Assigned (xE). Modern systems — including iOS, Android, virtualization platforms, containers, and privacy-preserving network stacks — use these ranges extensively. This patch updates the classification logic to implement RFC 9542 semantics: - Decode SLAP quadrants for local addresses (x2/x6/xA/xE) - Distinguish global vendor MACs from global addresses with unknown vendors - Correctly identify multicast addresses (bit 0 set) and avoid mislabeling them as local - Preserve support for mock ip- addresses and malformed/unknown formats This improves accuracy for randomized mobile MACs, manufacturer local address blocks, protocol-assigned local addresses, and security-focused deployments where correct interpretation of the first-octet bit fields matters. Signed-off-by: Robin Getz <rgetz503@gmail.com>
|
Ok - I think this is the way to do it - display them all as "Locally Administered", and a mouse over will decode the SLAP encodings. Opinions welcome. |







What does this PR aim to accomplish?:
In RFC7042 section 2.1 specifies the “Local bit”:
The Local bit is zero for globally unique EUI-48 identifiers
assigned by the owner of an OUI or owner of a longer prefix.
If the Local bit is a one, the identifier has been considered
by IEEE 802 to be a local identifier under the control of the
local network administrator...
Both iOS and Android use this as part of their randomized anti-tracking mechanisms. So, display it to admins, so they can tell what device is their phone.
How does this PR accomplish the above?:
If there is no decoded manufacture, check the private bit, and then print "Private MAC"
By submitting this pull request, I confirm the following:
git rebase)