Hi,
Centos 5.4, dual igb ethernet, kvm guest (Centos 5.4). br0 is connected to eth0, guest has virtio ethernet connected to br0. Guest is configured using virt-manager. When host is booting, br0 gets mac address of eth0.
Every time i start guest (with virt-manager) vnet0 appears and br0 mac aadressi on host is changed. Why does it need to change the mac? I'd like to keep it same, not to change it every time guest is booting.
The mac address shouldn't change. Are you setting the mac address of the guest to be the same as the host?
compdoc wrote:
The mac address shouldn't change. Are you setting the mac address of the guest to be the same as the host?
I'm not sure what you are asking, but I'm trying to give all relevant information.
Host interfaces: # ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100 link/ether f4:ce:46:b3:87:14 brd ff:ff:ff:ff:ff:ff 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 link/ether f4:ce:46:b3:87:15 brd ff:ff:ff:ff:ff:ff 4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue link/ether 96:8d:9e:09:0e:6a brd ff:ff:ff:ff:ff:ff inet 172.21.1.233/24 brd 172.21.1.255 scope global br0 6: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 500 link/ether 96:8d:9e:09:0e:6a brd ff:ff:ff:ff:ff:ff
guest interfaces: # ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:16:3e:51:9b:2a brd ff:ff:ff:ff:ff:ff
*before* guest is booted there is no vnet0, when vnet0 goes up, br0 mac changes from f4:ce:46:b3:87:14 to 96:8d:9e:09:0e:6a
when guest is not running, host's interfaces are: # ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100 link/ether f4:ce:46:b3:87:14 brd ff:ff:ff:ff:ff:ff 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 link/ether f4:ce:46:b3:87:15 brd ff:ff:ff:ff:ff:ff 4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue link/ether f4:ce:46:b3:87:14 brd ff:ff:ff:ff:ff:ff inet 172.21.1.233/24 brd 172.21.1.255 scope global br0
guests config file includes: <interface type='bridge'> <mac address='00:16:3e:51:9b:2a'/> <source bridge='br0'/> <model type='virtio'/> </interface>
guest's /etc/sysconfig/network-scripts/ifcfg-eth0 includes HWADDR=00:16:3e:51:9b:2a
host /etc/sysconfig/network-scripts/ifcfg-eth0 HWADDR=F4:CE:46:B3:87:14 host /etc/sysconfig/network-scripts/ifcfg-eth1 HWADDR=F4:CE:46:B3:87:15 host /etc/sysconfig/network-scripts/ifcfg-br0 does not have HWADDRESS specified
From where does come that 96:8d:9e:09:0e:6a ? It seems random. Forcing HWADDR to br0 has no effect, vnet0 still gets random mac every time the guest is started and changes br0 mac to whatever mac vnet0 has and when vnet0 goes down, br0 gets eth0's mac address back.
-- Veiko
A bridge should take on the mac address of the hardware device its sharing, and although I cannot see your ifcfg- scripts it looks like you have that correct. But could you post your ifcfg-br0 and the others?
One difference I can see is that you use the virtio model nics in your guests and I don't.
Also, it looks as though you have a pair of onboard nics, since the mac addresses are so alike. They aren't setup in any sort of gang-mode in the bios?
To be honest, I've never looked at the mac addresses of the bridges or vnets to see if they change, but I doesn't make sense that they would...