More MAC Address Mayhem – SLES Edition

Remember this? No? Well, go back and read it. I can wait. … Done? Good.

The gist of the last post, was that if you cloned, or copied a Ubuntu VM from one host to another, the UUID changes. That UUID is the basis for part of the generated MAC address, which then changes, causing me a headache. Today I found that SLES (Suse Linux Enterprise Server) is guilty of the same binding, only much to my chagrin it stores the rules file with another name: /etc/udev/rules.d/30-net_persistent_names.rules

The procedure to fix it is the same as listed before:

# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.

# PCI device 0×1022:0×2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:02:51:cf", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

An ugly beast of a file but that last line is the one that needs deleting. Another method of doing this, is to edit the ‘persistent-net-generator.rules’ file to include something similar to:

# ignore VMware virtual interfaces
ATTR{address}=="00:0c:29:*", GOTO="persistent_net_generator_end"

This procedure should work with most distributions that use this method to map the NICs and eth interfaces, and it should only be a matter of finding and editing the corresponding file. If you have any questions or comments, hit me up on twitter, or in the comments.

One thought on “More MAC Address Mayhem – SLES Edition”

  • My VM had multiple nics. Deleting all SUBSYSTEM==”net” lines from : /etc/udev/rules.d/30-net_persistent_names.rules and restarting the VM fixed it right up.

Comments are closed.