Skip to content
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

Add method to check local bit in MAC address #380

Open
sevdog opened this issue Apr 16, 2024 · 1 comment
Open

Add method to check local bit in MAC address #380

sevdog opened this issue Apr 16, 2024 · 1 comment

Comments

@sevdog
Copy link

sevdog commented Apr 16, 2024

Many devices use fake/random MAC address using the "local bit" defined in RFC 7042 section 2.1:

Two bits within the initial octet of an EUI-48 have special significance in MAC addresses: the Group bit (01) and the Local bit (02). OUIs and longer MAC prefixes are assigned with the Local bit zero and the Group bit unspecified. Multicast identifiers may be constructed by turning on the Group bit, and unicast identifiers may be constructed by leaving the Group bit zero.

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; however, there may be emerging recommendations from the IEEE Registration Authority on management of the local address space. If the Local bit is on, the holder of an OUI has no special authority over MAC identifiers whose first 3 octets correspond to their OUI.

It would be handy to have a method to check whenever a MAC is to be considered local (and possible randomized) or not.

See also this post for reference.

@jstasiak
Copy link
Contributor

That sounds useful, I'd be happy to accept a PR that implements this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants