Early june, I blogged about Wake-on-LAN from a Windows machine.
My plan was to adopt [Wayback/Archive.is] Wake.ps1
into Wake-on-LAN.ps1
(as naming is important).
One of the goals was to support multiple hardware MAC address formats, especially as Wake.ps1
had the below comment, but did support the AA-BB-CC-DD-EE-FF
, though not the AA:BB:CC:DD:EE:FF
hardware MAC address format:
<# ... .NOTES Make sure the MAC addresses supplied don't contain "-" or ".". #>
A colon separated hardware MAC address would result in this error inside the call to the [Wayback/Archive.is] PhysicalAddress.Parse Method (System.Net.NetworkInformation) | Microsoft Docs:
Send-Packet : Exception calling "Parse" with "1" argument(s): "An invalid physical address was specified."
So I did some digging, starting inside the above mentioned blog post, and adding more:
- Wake.ps1 uses the [Wayback/Archive.is]
Parse
method in the [Wayback/Archive.is] PhysicalAddress.cs source code in C# .NET, which contains code like this:
//has dashes? if (address.IndexOf('-') >= 0 ){ hasDashes = true; buffer = new byte[(address.Length+1)/3]; }
- The Perl script at [Wayback/Archive.is] wakeonlan/wakeonlan at master · jpoliv/wakeonlan that started my first blog post in this series which mentions:
xx:xx:xx:xx:xx:xx
(canonical)xx-xx-xx-xx-xx-xx
(Windows)xxxxxx-xxxxxx
(Hewlett-Packard switches)xxxxxxxxxxxx
(Intel Landesk)
I should rename the first one IEEE 802, as per this:
- The MAC address: Notational conventions – Wikipedia
The standard (IEEE 802) format for printing EUI-48 addresses in human-friendly form is six groups of two hexadecimal digits, separated by hyphens (
-
) in transmission order (e.g.01-23-45-67-89-AB
). This form is also commonly used for EUI-64 (e.g.01-23-45-67-89-AB-CD-EF
).[2] Other conventions include six groups of two hexadecimal digits separated by colons (:) (e.g.01:23:45:67:89:AB
), and three groups of four hexadecimal digits separated by dots (.) (e.g.0123.4567.89AB
); again in transmission order.[30]The latter is used by Cisco (see for instance [Wayback/Archive.is] Cisco DCNM Security Configuration Guide, Release 4.0 – Configuring MAC ACLs [Support] – Cisco and [Wayback/Archive.is] Cisco IOS LAN Switching Command Reference – mac address-group through revision [Support] – Cisco), so another format to add:
xxxx.xxxx.xxxx
(Cisco)
- [Wayback/Archive.is] PhysicalAddress.Parse Method (System.Net.NetworkInformation) | Microsoft Docs remarks:
The
address
parameter must contain a string that can only consist of numbers and letters as hexadecimal digits. Some examples of string formats that are acceptable are as follows:001122334455
00-11-22-33-44-55
0011.2233.4455
00:11:22:33:44:55
F0-E1-D2-C3-B4-A5
f0-e1-d2-c3-b4-a5
Use the GetAddressBytes method to retrieve the address from an existing PhysicalAddress instance.
- After a bit more digging via [Wayback/Archive.is] “three groups of four hexadecimal digits separated by dots” – Google Search , I found that even more hardware MAC address formats are in use as per [Wayback/Archive.is] What are the various standard and industry practice ways to express a 48-bit MAC address? – Network Engineering Stack Exchange.
I really do not have all the sources for the various representations for 48-bit MAC addresses, but I have seen them variously used:
AA-BB-CC-DD-EE-FF AA.BB.CC.DD.EE.FF AA:BB:CC:DD:EE:FF AAA-BBB-CCC-DDD AAA.BBB.CCC.DDD AAA:BBB:CCC:DDD AAAA-BBBB-CCCC AAAA.BBBB.CCCC AAAA:BBBB:CCCC AAAAAA-BBBBBB AAAAAA.BBBBBB AAAAAA:BBBBBB
From the last list, which is far more complete than the others, I recognise quite a few from tools I used in the past, but too forgot the actual sources, so I took the full list from there and tried to name them in parenthesis after the links I found above and what I remembered:
AABBCCDDEEFF
(Bare / Landesk)AA-BB-CC-DD-EE-FF
(IEEE 802 / Windows)AA.BB.CC.DD.EE.FF
(???)AA:BB:CC:DD:EE:FF
(Linux / BSD / MacOS)AAA-BBB-CCC-DDD
(???)AAA.BBB.CCC.DDD
(Cisco?)AAA:BBB:CCC:DDD
(???)AAAA-BBBB-CCCC
(???)AAAA.BBBB.CCCC
(Cisco / Brocade)AAAA:BBBB:CCCC
(???)AAAAAA-BBBBBB
(Hewlett-Packard networking)AAAAAA.BBBBBB
(???)AAAAAA:BBBBBB
(???)
Some additional links in addition to the ones above:
- (Formerly Intel) Ivanty Landesk: [Wayback/Archive.is] Creating a Query to search by MAC Address
- Windows: [Wayback/Archive.is] arp | Microsoft Docs
- Linux: [Wayback/Archive.is] Linux networking: arp versus ip neighbour | Enable Sysadmin
- BSD: [Wayback/Archive.is] arp(8) – OpenBSD manual pages
- MacOS: [Wayback/Archive.is] init(string:) | Apple Developer Documentation
- Cisco: [Wayback/Archive.is] Cisco Nexus 5000 Series NX-OS Software Configuration Guide – Configuring the MAC Address Table [Cisco Nexus 5000 Series Switches] – Cisco
- Hewlett-Packard switches: [Wayback/Archive.is] Viewing the switch’s MAC address tables
- Brocade: [Archive.is] IBM b-type Data Center Networking: Design and Best Practices Introduction – Jon Tate, Norman Bogard, Michal Holenia, Sebastian Oglaza, Steven Tong, IBM Redbooks – Google Books / [Wayback/Archive.is] Network Fun!!! — A Security/Network Engineer’s Blog: How To Configure A Stack On A Brocade (Foundry) FCX648SHPOE
–jeroen