Ethernet MAC address issues

Some boards with embedded Ethernet devices do not have a MAC address blown into the serial EEPROM. If this is the case, then attempting to connect them to a network causes the following error message to be displayed:

eth0: Invalid ethernet MAC address. 
Please set using ifconfig

To overcome this, the Linux kernel includes a modification that enables the MAC address to be set from the command line. When building the kernel, enable this feature (CONFIG_NWHW_CONFIG) from the configuration menu as follows:

Device Drivers ---> Networking Support --->
Configure network hardware from the command line

Add the MAC address to the boot command in the form:

nwhwconf=device:<dev>,hwaddr:<addr> 

where:

  • <dev> is the device name, normally eth0
  • <addr> is the MAC address, which has the form: xx:xx:xx:xx:xx:xx,
    (xx are hexadecimal characters)

Allocating MAC addresses

For the STEM board, a range of MAC addresses has been allocated retrospectively. The serial number of the board is a valid MAC address.

For other boards, the MAC address to use must be unique to the local network. Consult your network administrator to find which numbers have been allocated locally. Certain ranges of addresses are not allocated to card vendors, and a list of these is available at http://www.certsoft.com/mac.htm.

One way to generate a locally-unique MAC address is to use one of the locally administrated OUI ranges, with a locally unique number (for instance the last three bytes of your IP address). So, for example, using the locally administrated AA0000xxxxxx OUI range with an IP address of 164.129.89.7 (hexadecimal A4.81.59.07), a generated suitably locally unique MAC address may be AA:00:00:81:59:07.