Debian eth0, eth1, eth2, in Virtualbox or VMware Virtual machines when copying

uses udev. Udev handles mapping MAC’s to the appropriate /dev/(X) file. If you copy a Virtual machine, Udev will remember the MAC address of the old NIC. When you copy the machine, the virtual host usually generates a new MAC address for the .
Udev will assign the new Device to eth1, eth2, and so on. If you want to change your NIC assignments make Udev forget the old MAC.
In Debian 5 (lenny) it is in this file:

/etc/udev/rules.d/70-persistent-net.rules

In Debian 4 (etch) it is in this file:

/etc/udev/rules.d/z25_persistent-net.rules

To apply changes in Lenny: “udevadm trigger” or “udevtrigger” (in Etch)

  1. Pretty useful info. Was confused as to why the machine kept creating new eth devices and so messing up my static configuration for one of the devices.

    Cheers for the explanation.

    • eric m
    • June 2nd, 2010

    maybe add a line to your .bashrc pointing to a script that clears the persistent rules file on startup

    just an idea..

  1. October 1st, 2011