Skip to contentSkip to conversation

Do not create persistent name rules for KVM network interfaces

PATCH Marco d'Itri 4 participants 6 messages Aug 27, 2010 – Sep 3, 2010

lore
Share & tools
lore
#0 lore raw
Signature · 3 lines
-- 
ciao,
Marco

Do not create persistent name rules for KVM network interfaces.

The virtual interfaces created by KVM are stable, 54:52:00 is the MAC-48 range of KVM: http://www.coffer.com/mac_find/?string=545200 .

extras/rule_generator/75-persistent-net-generator.rules +3 -0
@@ -29,6 +29,9 @@ ENV{MATCHADDR}="$attr{address}"
 # match interface type
 ENV{MATCHIFTYPE}="$attr{type}"
 
+# ignore KVM virtual interfaces
+ENV{MATCHADDR}=="54:52:00:*", GOTO="persistent_net_generator_end"
+
 # These vendors are known to violate the local MAC address assignment scheme
 # Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom
 ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist"
#1 lore raw

Hello Marco,

Marco d'Itri [2010-08-27 18:35 +0200]:

Quoted 4 lines

Do not create persistent name rules for KVM network interfaces.

The virtual interfaces created by KVM are stable, 54:52:00 is the MAC-48 range of KVM: http://www.coffer.com/mac_find/?stringT5200 .

Thanks for this. This got committed yesterday. However, it seems that coffer.com is wrong: When I boot kvm, I really get a 52:54:00:* address. Please see the qemu git for this:

http://git.savannah.gnu.org/cgit/qemu.git/tree/net.c#n796

I pushed that as c03180194cb62cda286efcc1563391a1408394ff.

For VMWare, all the google hits seem to agree to each other (00:0c:29:* and 00:50:56:*), so I committed that as well in d4de0a0321b471e9dd8c32f1f3266b0b466457c7. Xen already seems covered, so I didn't add a filter for those.

Thanks,

Martin

Signature · 2 lines
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
#2 lore raw
In reply to Marco d'Itri
Quoted 3 lines · Martin Pitt

Thanks for this. This got committed yesterday. However, it seems that coffer.com is wrong: When I boot kvm, I really get a 52:54:00:* address. Please see the qemu git for this:

Maybe we need both? I am quite sure that my KVM guests running on RHEL hosts get 54:52:00:*.
OTOH, I do not know what sets the MAC address in the provisioning process.

Signature · 2 lines
ciao,
Marco
#3 lore raw
In reply to Marco d'Itri

Hello Marco,

Marco d'Itri [2010-09-02 10:32 +0200]:

Quoted 2 lines

Maybe we need both? I am quite sure that my KVM guests running on RHEL hosts get 54:52:00:*.

OK, sorry for second-guessing you then. When using 100% accurate and reliable statistical methods [1] *cough* *cough* it seems that 54:52:* is not unheard of indeed, so I just added it as an alternative now in [2].

Thanks,

Martin

[1] http://www.googlefight.com/index.php?lang=en_GB&word1=kvm+mac+52%3A54&word2=kvm+mac+54%3A52
[2] http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=634afac119bbe6bc21719ae3daa45805b1cf3334

Signature · 2 lines
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
#4 lore raw
In reply to Marco d'Itri
Quoted 10 lines · Martin Pitt

Hello Marco,

Marco d'Itri [2010-09-02 10:32 +0200]:

Quoted 2 lines

Maybe we need both? I am quite sure that my KVM guests running on RHEL hosts get 54:52:00:*.

OK, sorry for second-guessing you then. When using 100% accurate and reliable statistical methods [1] *cough* *cough* it seems that 54:52:* is not unheard of indeed, so I just added it as an alternative now in [2].

Hi,

It looks like virt-install is the program that had the wrong prefix at one point, fixed by this commit:
http://hg.fedorahosted.org/hg/python-virtinst/diff/a3334a88986f/virtinst/util.py

-jim