Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mineiro/5237144 to your computer and use it in GitHub Desktop.
Save mineiro/5237144 to your computer and use it in GitHub Desktop.
Create a CentOS Vagrant box with dynamic ethernet MAC address

Create a CentOS Vagrant box with dynamic ethernet MAC address

When preparing a CentOS box, you have to be careful about /etc/udev/rules.d/70-persistent-net-generator.rules and /etc/sysconfig/network-scripts/ifcfg-eth0, because it uses the MAC address of the interface to configure itself.

The way I found to overcome this, is by editing both files and removing some config lines.

Below are the modifications:

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

Remove the line where NAME="eth0" and insert the line below:

KERNEL=="eth0", NAME="eth0"

##/etc/sysconfig/network-scripts/ifcfg-eth0

Remove the lines where the parameters HWADDR and UIID appears.

Pack the box and game on.

@herdani
Copy link

herdani commented Mar 25, 2013

Works like a charm, thanks for this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment