MAC address

From Noah.org
Revision as of 12:02, 29 June 2012 by Root (talk | contribs)
Jump to navigationJump to search


MAC address

Organizationally Unique Identifier, or OUI

The first three bytes of a MAC address are the Organizationally Unique Identifier, or OUI. These addresses are assigned by the IEEE Registration Authority. You pay about $2000 for a reserved block.

locally administered address

A locally administered MAC address is similar to a local unroutable IP address. You can make up your own locally administered address and be sure that it will not collide with any hardware on your network that use a factory burned-in MAC address. Locally administered addresses are useful when creating virtual machines or virtual interfaces.

The second bit of the first byte of a MAC address determines the type of OUI. If the bit is 0 then it is an OUI globally assigned by the IEEE; if the bit is 1 then it is a locally administered MAC address.

Create a OUI by whatever scheme you like, then logically OR it with 02:00:00:00:00:00, and then logically AND it with fe:ff:ff:ff:ff:ff, and you will have a locally administered address. The first OR pattern sets bit 2 of the first byte; the second AND pattern clears bit 1 of the first byte (unicast, not multicast).

change MAC address

The following sets eth0 interface to use a locally administered address:

ifconfig eth0 hw ether 02:00:00:00:00:01

or using iproute2 commands you would use the following:

ip link set dev eth0 address 02:00:00:00:00:01