Renaming / Renumbering Network Interfaces

If you have network interfaces that no longer counts from 0 or 1 because you’ve added and removed a network card, you may force Linux to renumber the interfaces by modifying the udev rules and network configs.

The simplest solution would be to:

  1. Delete (or edit out old entries in) /etc/udev/rules.d/70-persistent-net.rules
  2. Edit the network scripts in /etc/sysconfig/network-scripts/ifcfg-* and delete any extraneous configs.
  3. Reboot

Ensure that your network configs match the interfaces when the system comes back up.

Getting Hardware UUID

The UUID is a 128-bit universally unique identifier which is burned on the motherboard on a system. It’s typically represented as a 32 character string separated into groups  of 8, 4, 4, 4, 12 characters by a dash.

An example of a UUID is:

5178962d-2fcf-df50-536d-000423d9985a

This can be assumed to be unique to a computer. The only time I encountered collisions were when two Dell servers did not have the asset tag set which suggests that the UUID is a function of certain parameters on these servers.

To get the UUID on Windows, the simplest way is to use PowerShell:

get-wmiobject Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID

To get the UUID on Linux or FreeBSD, use dmidecode which can be installed through mots package managers (yum, apt-get, pacman, etc) or through ports at /usr/ports/sysutils/dmidecode.

dmidecode | grep -i uuid

To get the UUID on VMWare ESXi or vSphere, login via SSH and run:

esxcfg-info | grep -i uuid

You will see a bunch of UUIDs, most of which pertain to disks/volumes. What you are looking for is:

|----System UUID..............................................5178962d-2fcf-df50-536d-000423d9985a