notes-infineon/_-Review/mac-address.md
2024-06-03 07:04:29 -07:00

1.3 KiB
Raw Permalink Blame History

type, created, updated
type created updated
note 2024-04-01T21:06:55.003Z 2024-04-01T21:30:11.439Z

MAC Address

Locally Administered Addresses are defined by one particular bit out of the 6 bytes - specifically, the second-least-significant bit of the first octet. This means that you can choose any MAC addresses that you want, as long as it matches one of:

  • X2XX-XX-XX-XX-XX
  • X6XX-XX-XX-XX-XX
  • XAXX-XX-XX-XX-XX
  • XEXX-XX-XX-XX-XX

Regex Simple

  • [0-9A-Fa-f]2:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}
  • [0-9A-Fa-f]6:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}
  • [0-9A-Fa-f]A:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}
  • [0-9A-Fa-f]E:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}:[0-9A-Fa-f]{2}

Regex Complex

  • ([0-9A-Fa-f]{1}2[:-])([0-9A-Fa-f]{2}[:-]){4}([0-9A-Fa-f]{2})
  • ([0-9A-Fa-f]{1}6[:-])([0-9A-Fa-f]{2}[:-]){4}([0-9A-Fa-f]{2})
  • ([0-9A-Fa-f]{1}A[:-])([0-9A-Fa-f]{2}[:-]){4}([0-9A-Fa-f]{2})
  • ([0-9A-Fa-f]{1}E[:-])([0-9A-Fa-f]{2}[:-]){4}([0-9A-Fa-f]{2})

If you want to know why you can use 2, 6, A, and E, but not 3, 7, B, or F, that's because the latter ones are reserved for Multicast whereas the former are Unicast.