After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 546197 - support bridges
support bridges
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other All
: Normal enhancement
: ---
Assigned To: Pavel Simerda
NetworkManager maintainer(s)
: 543232 549393 (view as bug list)
Depends on: 683205 683208
Blocks: nm-0.9.8
 
 
Reported: 2008-08-04 09:14 UTC by psl
Modified: 2013-02-04 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8



Description psl 2008-08-04 09:14:35 UTC
Please describe the problem:
Ubuntu 8.04, i386. NM-applet 0.6.6.
I run VirtualBox and I need bridge configuration to support several virtual interfaces in my virtual machines. eth0 (real NIC) is configured as a part of br0 in /etc/network/interfaces, DHCP is configured for br0. When gnome starts, network doesn't work, I see two default interfaces, one for eth0 and second one for br0. I have to manually delete one of them to fix my network (route del default). I think he source of this issue is Gnome Network Manager that supports only eth0 but I cannot configure br0 there.

Steps to reproduce:
1. 
/etc/network/interfaces:
auto lo
iface lo inet loopback
auto eth0
#iface eth0 inet dhcp
#iface eth0 inet manual
auto br0
iface br0 inet dhcp
bridge_ports eth0

2. 
Login to Gnome, check with "iproute"; In my case, I see two interfaces with default route. Default route should be assigned to br0 only from my point of view.

3. 


Actual results:
Two default routes defined for eth0 and br0.
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.222.0   *               255.255.255.0   U     0      0        0 br0
link-local      *               255.255.0.0     U     1000   0        0 br0
default         ipcop.home      0.0.0.0         UG    100    0        0 br0
default         ipcop.home      0.0.0.0         UG    100    0        0 eth0


Expected results:
NM should not touch eth0 interface...

Does this happen every time?
100%

Other information:
I cannot configure eth0 as part of a bridge in NM, it can be only in roaming mode or can be configured for DHCP or manual (with fix IP address). I miss support for bridge interface in NM.
Comment 1 Dan Williams 2009-02-03 12:45:16 UTC
*** Bug 549393 has been marked as a duplicate of this bug. ***
Comment 2 Dan Williams 2009-02-24 00:11:57 UTC
*** Bug 543232 has been marked as a duplicate of this bug. ***
Comment 3 Derek Frye 2009-04-23 23:20:02 UTC
I also experience this bug, for the same version of Ubuntu as the submitter. It doesn't look like 0.7.1 adds this enhancement, but it'd certainly be nice to be able to configure bridging through NM in some future version.
Comment 4 W. Michael Petullo 2010-09-27 23:12:18 UTC
It seems that NetworkManager should:

1. Set up any system-wide bridge devices using "brctl addbr ...". For example, /etc/sysconfig/network-scripts/ifcfg-virbr0 on Fedora:

DEVICE=virbr0
TYPE=Bridge
ONBOOT=yes
USERCTL=no
BOOTPROTO=dhcp

2. Set up associated physical devices "brctl addif ...". For example, /etc/sysconfig/network-scripts/ifcfg-eth0 on Fedora:

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
USERCTL=no
BOOTPROTO=none
BRIDGE=virbr0

3. Initialize the BOOTPROTO of the bridge device once its physical devices are setup.

4. Allow a user to create such configurations using nm-configuration-editor.

This is important for many use cases, including several virtualization options.
Comment 5 Tomasz Torcz 2010-09-28 05:24:16 UTC
Virtualisation per se is being talked in this Fedora feature: http://fedoraproject.org/wiki/Features/Shared_Network_Interface
This page mentions bug which already is marked as duplicate of this one.
Comment 6 Maxim Burgerhout 2011-03-01 13:04:33 UTC
It seems the Fedora Feature mentioned in Comment 5 has not been followed through. Can someone give an update on the status of this bug?
Comment 7 Bruno Friedmann 2011-07-22 06:17:57 UTC
Should this bug have the version upgraded 
It seems there's zaro progress in 0.9 in this area.
Comment 8 Martti Laakso 2011-08-17 19:24:19 UTC
This definitively is still a major showstopper. I don't mind configuring a dummy or virtual interface manually for network-manager, but currently this doesn't seem to work either.
Comment 9 Martin Meyer 2011-10-13 13:36:10 UTC
I'm having similar problems using a bridged connection for KVM on Fedora 16 beta. To make matters worse, it seems impossible to keep the NetworkManager service disabled (seems to start as a dependency, arguably because systemd is either awesome or mean-spirited, I can't decide which...), so things like Empathy and Pidgin think I'm always disconnected now.

I think that some of the code for bridge management from virt-manager might be useful to implement this in NetworkManager. I believe it's all written in Python, and I don't know what language NM is in.

Even if we can't get true bridge support for configuration, could we at least get NM to recognize the you-are-connected-to-a-network state even if you're connected via an unmanaged connection? Is that even possible? I mean, it could just check and see that one of my adapters has an IP address and that I seem to have a default route present...
Comment 10 Sean Channel 2012-02-17 08:40:43 UTC
Just to add another vote in favor of this enhancement; I would be thrilled to be able to setup and manage bridged networking esp. via nm-applet instead of manually configuring these things temporarily (at this time on Ubuntu Oneiric).

Perhaps there's something I can do to help. Will look into it further (not presently a contributor).
Comment 11 Ivan 2012-04-02 07:59:35 UTC
It would be good to support bridge on demand also - i.e. i want to use usb0 for my phone as bridge to any available inet interface, so when usb0 is apper (phone connectes) bridge it to available inet connection (eth or wlan or ppp etc)
Comment 12 Bohuslav "Slavek" Kabrda 2012-05-07 09:53:24 UTC
+1 from me. Is anyone working on adding support for network bridges to NM?
Thanks guys.
Comment 13 Vít Ondruch 2012-05-07 10:31:54 UTC
I'd like to use PXE boot from KVM. Please add bridge support into NM. Thank you.
Comment 14 Gonzalo Aguilar Delgado 2012-05-20 18:56:41 UTC
+1 for me also. It's important since "boxes" project is coming to the desktop. You will want users to be able to use kvm with bridge support so every machine will se others in the local network.

But you will want users to use fantastic NM VPN support and Wireless config. 

This is also my case. Want to use kvm instead of virtualbox. 
But maintain VPN support because it's easier to configure VPNs from NM. It's a great tool.

Currently I cannot drop VirtualBox because I need bridging support in kvm machines and I have lots of VPN networks configured in my NM interface. And they just work well!! I don't want to switch to command-line configuration again.

Also don't want to switch my bridge on/off all the time.

Tnx in advance
Comment 15 techtonik 2012-06-26 16:16:06 UTC
Is that bridging the only way how to see (ping) guest interface from the host?
Comment 16 Dan Winship 2012-06-26 17:48:36 UTC
this is being worked on and will probably be in the next major NM release (August/Septemberish)
Comment 17 Pavel Simerda 2012-08-17 00:18:48 UTC
Bridging is *not* available in NetworkManager 0.9.6. There is a branch called 'bridge' with the bridging implementation from Thomas Graf that has not yet been merged. It is reported to be mostly working but the bridged interfaces won't start
automatically with NetworkManager. We should be targeting 0.9.8.
Comment 18 Pavel Simerda 2012-09-02 16:35:38 UTC
I'm taking this. I've ported NetworkManager bridging patches written by Thomas Graf to my 'pavlix/platform' branch. The result of this porting effort can be
viewed in 'pavlix/bridge' branch.

Current status:

A very basic bridge configuration with a static address and one ethernet
interface works for me. I'm testing it with the following configuration
files:

/etc/NetworkManager/system-connections/Bridge:

[connection]
id=Bridge
uuid=b8eca181-73e2-455d-b5be-bffcde75c153
type=bridge
[bridge]
interface-name=br0
[ipv4]
method=manual
addresses1=192.168.2.200;24;192.168.2.1
[ipv6]
method=link-local

/etc/NetworkManager/system-connections/Ethernet:

[connection]
id=Ethernet
uuid=788f8873-7d55-420f-8e91-6e3ab028ebf6
type=802-3-ethernet
master=br0
[ipv4]
method=disabled
[ipv6]
method=link-local
[802-3-ethernet]
mac-address=52:54:00:8e:93:da
Comment 19 Pavel Simerda 2012-09-03 00:59:30 UTC
Patches can now be found in 'pavlix/next' together with a bunch of other stuff. They have been improved to support the following configuration:

Master:

[connection]
id=Master
uuid=b8eca181-73e2-455d-b5be-bffcde75c153
type=bridge
[bridge]
interface-name=master
[ipv4]
method=manual
addresses1=192.168.2.200;24;192.168.2.1
[ipv6]
method=link-local

Slave:

[connection]
id=Slave
uuid=788f8873-7d55-420f-8e91-6e3ab028ebf6
type=802-3-ethernet
master=master
[802-3-ethernet]
mac-address=52:54:00:8e:93:da

The main improvement is that Slave doesn't require bogus IP setting
sections. IPv4 method of Master must be manual so it doesn't depend
on the Slave's status. IPv6 could most probably be 'manual' too but
I don't know the correct format for IPv6 addresses in keyfile.

At exit, NetworkManager releases the Slave from the Master, remove
its IP configuration, sets it down but doesn't remove it.

This behaviour should be fine for most basic IPv4-only use cases.
Comment 20 David Jaša 2012-09-20 09:07:10 UTC
(In reply to comment #19)
<snip>
> The main improvement is that Slave doesn't require bogus IP setting
> sections. IPv4 method of Master must be manual so it doesn't depend
> on the Slave's status.

For virtualized environments, it would be beneficial to be able to define IP settings in Slave stanza configuring the physical interface, so that NM tries to get DHCP info on bridged interface only if the physical interface is up.
Comment 21 Pavel Simerda 2012-09-21 14:10:26 UTC
Branch 'pavlix/next' has been modified and now also supports automatic IPv4/IPv6
configuration of bridges and bonds.
Comment 22 Pavel Simerda 2012-09-24 09:13:28 UTC
> > IPv4 method of Master must be manual so it doesn't depend
> > on the Slave's status.
> 
> For virtualized environments, it would be beneficial to be able to define IP
> settings in Slave stanza configuring the physical interface, so that NM tries
> to get DHCP info on bridged interface only if the physical interface is up.

My remark about manual IPv4/IPv6 is no longer valid in 'pavlix/next' as the slaves depend on master's 'connecting' state, not 'connected' state. That means
the master device is already prepared (created) but the IP configuration is
not finished.

There is still a lot of space for improvement and I will need to carefully
observe the logs to check that it's actually doing what I believe it is doing.
But for now the DHCP at least starts close to the time the master is created
and the slaves join it.

I don't think slaves should have more settings than those needed to enslave them :).
Comment 23 Dan Winship 2013-02-01 17:52:09 UTC
This has been working in master for a while... there are still issues, but we're at the point where they should be separate bugs
Comment 24 Dan Williams 2013-02-04 18:29:29 UTC
Merge branch review for updates and further fixes was https://bugzilla.gnome.org/show_bug.cgi?id=692317
Comment 25 Pavel Simerda 2013-02-04 21:47:16 UTC
Let's have a big party in Brno!