If I have a MAC represented as:

0:b:23:26:32:52

is that the same as:

00:0b:23:26:32:52

or:

00:bb:23:26:32:52

?

link|improve this question

feedback

migrated from stackoverflow.com Apr 22 '10 at 17:35

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 6 down vote accepted

You would add the leading zeros, not repeat single characters (so 00:0b:23:26:32:52, yes).

Chances are that the application in question just didn't format its output correctly with the leading zeros.

irb(main):003:0> sprintf '%X', 11
=> "B"
irb(main):004:0> sprintf '%02X', 11
=> "0B"

If you wanted to (somewhat) verify this, you could use a MAC lookup tool to check the manufacturer of the device.

According to MAC_Find, the 00:0b:23 prefix belongs to "Siemens Subscriber Network", while the other one is unknown. That's not 100% proof of anything, but if you know the device is a Siemens device, that would be enough verification for most cases.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.