Ked presunieme virtualku z jedneho ESXi hosta na druheho, moze sa stat (akoze sa aj stane) ze sa zmeni povodny eth0 interface na eth1.To je sposobene ze novy ESXi pridadi virtualke inu mac adresu ako bola povodna.Ak to chcem upravit naspat bez toho aby sme konfigurovali novy eth1 interface bude treba upravit udev rules.
Najprv si skontrolujeme povodny udev rule kde uvidime mac adresu ktora je viazana s interfacim eth0.
[root@test ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# 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, and change only the value of the NAME= key.
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:94:f8:1b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Rovnaka mac adresa je aj v konfiguracnych skriptoch pre interface eth0
[root@test ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=38b87a53-aab1-454b-9cdf-7cd5357edfdb
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=00:0C:29:94:f8:1b
IPADDR=10.10.10.16
PREFIX=27
GATEWAY=10.10.10.1
DNS1=10.10.10.1
DEFROUTE=yes
NAME="System eth0"
Ked presunieme VMku vidime ze nam v udev rules vznikol novy interaface eth1 s novou mac adresou.
[root@test ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# 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, and change only the value of the NAME= key.
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:94:f8:1b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:c7:65:54", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
Ak chceme aby VMka pouzivala povodny eth0 interface bude treba zmamzat z udev rulov zaznam pre interface eth1 a zmenit mac adresu na povodnu v udev pravidlach /etc/udev/rules.d/70-persistent-net.rules a rovnako aj v /etc/sysconfig/network-scripts/ifcfg-eth0. Nasledneme restartneme VMku a nabehne s funkcnym eth0 interfacom.
Este nesmieme zabudnut ze pre presune masiny ESXi strati zaznamy (aspon pri mojej free verzii) o sietovych nastaveniach a treba nanovo pridat vlanu vmxnet interfacu.