[MINIX LOGO]

Choosing your own ethernet address

modified: 22 Feb 2004


Normally one does not change the ethernet address assigned to a node. Every manufactured ethernet adapter has a unique address, so why change it? Well, that's fine for real ethernet hardware, but when you start to use a system like the Bochs emulator it's different. Bochs presents a virtual ethernet interface to the guest operating system, and Bochs presents the ethernet address you assign to this virtual interface to the real network to which you connect. So you need to have some way to decide what address to use.

If you are only working with one emulated system, there's no problem. The niclist program supplied with Bochs will suggest using b0:c4:20:00:00:00 as your address. And chances are, if you need several addresses for several emulated systems and you just use b0:c4:20:00:00:01, b0:c4:20:00:00:02, etc., you'll be OK.

But, there is a better way to choose your own ethernet addresses. The rest of this page is from an e-mail Kees Bot sent me describing his system. This seems like a good way to manage multiple virtual addresses.

Kees Bot <kjb@cs.vu.nl> wrote on 12 Feb 2004:

IEEE 802.3 section 3.2.3 defines the Ethernet (MAC) address format. A 48-bit address starts with a broadcast bit (octet 0, bit 0) that is set to 1 for a broadcast and is followed by a "global/local administration" flag bit (octet 0, bit 1).

If octet 0, bit 1 is clear then the address must be globally unique, otherwise locally unique. So one can administer one's own ethernet addresses with octet 0, bit 1 set.

I wanted to make sure I had this right, so I searched for this information with Google first, only to find out that there are a few vendor IDs that have the G/L admin bit set. So I checked the copy of 802.3 on good old dead tree format that one of my collegues has and it confirmed what I thought I knew.

I'm going with the standard personally and declare all ethernet addresses that have (addr[0] & 2) set to be mine to use. Bochs could request their own vendor ID, of course, and choose the low 24 bits at random, but then they'd no longer be globally unique as they should be.

(I'm using 42:NN:XX:XX:XX:XX, where XX is the IP address of the system I'm running Bochs on in hex, and NN is the N-th .bxrc file I got, so I can run two or more simulations at the same time.)

Examples:
IP address of the real machine: 192.168.23.6
Changed to hex: c0:a8:17:06
Prepend "local use" prefix: 42:00:c0:a8:17:06
Another .bxrc? 42:01:c0:a8:17:06
And another? 42:02:c0:a8:17:06
etc.

Return to the Minix on Bochs on Windows How-to


[HOME] [HINTS/FAQ] [MINIX DOWNLOADS] [CONTRIB SOFTWARE]
[NET SOFTWARE] [MINIX-VMD] [TEXTBOOK] [LINKS]

All material on this site not otherwise attributed is copyright ©1994-2004 Albert S. Woodhull
Click here for information on copying and other use.
Mail comments on this page to: Al Woodhull <awoodhull@hampshire.edu>
Viewable With Any Browser    [Valid HTML 4.0!]