Bug 755304

Summary: Bridge network for VMs has stopped to work on F16
Product: [Fedora] Fedora Reporter: Avi Alkalay <avibrazil>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: berrange, clalancette, crobinso, dougsland, itamar, jforbes, laine, rtguille, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-12 13:31:11 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Avi Alkalay 2011-11-20 10:11:27 EST
Description of problem:
I followed the guide at http://wiki.libvirt.org/page/Networking#Fedora.2FRHEL_Bridging
Also set "net.ipv4.ip_forward = 1" on /etc/sysctl.conf, just to make sure.
Also disabled iptables, ip6tables and selinux.

And configured my guest as:
<interface type='bridge'>
  <mac address='52:54:00:82:15:46'/>
  <source bridge='br0'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

When the guest is running, the vnet0 interface is created on the host:

host# ifconfig
br0       Link encap:Ethernet  HWaddr FE:54:00:82:15:46
          inet6 addr: fe80::a001:aeff:fe66:a2c2/64 Scope:Link
          inet6 addr: fe80::ac1d:64ff:febe:d90e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:766 errors:0 dropped:0 overruns:0 frame:0
          TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:86647 (84.6 KiB)  TX bytes:7704 (7.5 KiB)

em1       Link encap:Ethernet  HWaddr 00:26:18:45:E7:7E
          inet addr:172.16.174.4  Bcast:172.16.174.255  Mask:255.255.255.0
          inet6 addr: fe80::226:18ff:fe45:e77e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:258729 errors:0 dropped:0 overruns:0 frame:0
          TX packets:162207 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:26848443 (25.6 MiB)  TX bytes:471785702 (449.9 MiB)
          Interrupt:40 Base address:0xe000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:65598 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65598 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:79288846 (75.6 MiB)  TX bytes:79288846 (75.6 MiB)

vnet0     Link encap:Ethernet  HWaddr FE:54:00:82:15:46
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

But the guest is unable to get an IP from my LAN DHCP server. No communication  even if a set a valid fixed IP on the guest, as 172.16.174.6.

The guest is Windows 7 with virtio drivers.

This was working on Fedora 14.

Relevand lines from /var/log/messages:
Nov 20 12:59:50 fortal kernel: [ 6012.081648] br0: port 1(vnet0) entering forwarding state
Nov 20 12:59:50 fortal NetworkManager[1045]: <warn> /sys/devices/virtual/net/vnet0: couldn't determine device driver; ignoring...



Version-Release number of selected component (if applicable):
libvirt-0.9.6-2.fc16.x86_64
kernel-3.1.1-1.fc16.x86_64
iptables-1.4.12-2.fc16.x86_64
NetworkManager-0.9.1.90-5.git20110927.fc16.x86_64
initscripts-9.34-2.fc16.x86_64
Comment 1 Reartes Guillermo 2011-11-28 11:52:30 EST
Did you upgrade from a working f14 and it stopped working?

In your case, are you bridging em1 to br0 (and the guest to br0) ?
(because your lan is connected to em1)?
---

Here is an example from my f15/f16 dualboot machine:

# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
DELAY=0
IPADDR=192.168.0.10
NETWORK=192.168.0.0
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
MTU=1500
DNS1=192.168.0.1
IPV6INIT=no
USERCTL=no

# cat /etc/sysconfig/network-scripts/ifcfg-p33p1 
DEVICE=p33p1
HWADDR=FF:FF:FF:FF:FF:FF
ONBOOT=yes
BRIDGE=br0

After configuing these files, disable Network Manager (i do use static ip):

# systemctl stop NetworkManager.service
# systemctl disable NetworkManager.service

And enable traditional network service:

# systemctl enable network.service
# systemctl start network.servce


Now: 

# brctl show 
bridge name     bridge id               STP enabled     interfaces
br0             8000.14dae9299cf7       no              p33p1
virbr0          8000.000000000000       yes

With this setup, i set the guest to bridged using
"host device em1 (bridge 'br0')" i virt-manager
Comment 2 Fedora Admin XMLRPC Client 2011-11-30 14:33:28 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 3 Fedora Admin XMLRPC Client 2011-11-30 14:37:02 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 4 Fedora Admin XMLRPC Client 2011-11-30 14:44:26 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 5 Fedora Admin XMLRPC Client 2011-11-30 14:55:05 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 6 Laine Stump 2012-03-12 13:31:11 EDT
From the output of ifconfig, it appears that you have not fully followed the directions for creating a bridge device and connecting it to a physical ethernet device:

1) The bridge device has no IP address, but the physical ethernet does have an IP address. If the bridge is properly configured according to the page you reference, the bridge device will have an IP address, and the physical ethernet adapter will not.

2) Since a Linux bridge device takes on the numerically *lowest* MAC address of all attached devices, and your br0 device shows that it has the same MAC address as vnet0 (which is much *higher* than the MAC address of the physical device em1), it is clear that the physical device has not been attached to the bridge.

Please verify that your /etc/sysconfig/network-scripts/ifcfg-em1 and ifcfg-br0 are similar to those posted by Reartes Guillermo in Comment 1. If they are, and you are still experiencing the problem, feel free to re-open this bug report. In the meantime, I'm closing it as NOTABUG, since it appears to be a configuration problem (and if there is a bug, not a libvirt bug, since devices being configured outside of libvirt are obviously not correctly configured).
Comment 7 Avi Alkalay 2012-03-12 16:26:41 EDT
(In reply to comment #6)
Laine, thank you for this observations. I'll have a look in my system again to make sure everything is correct.