RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 605953 - RFE: Add a command to quickly setup a Bridge Networking for KVM
Summary: RFE: Add a command to quickly setup a Bridge Networking for KVM
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: Rhel5KvmTier3 747667 756082
TreeView+ depends on / blocked
 
Reported: 2010-06-19 15:41 UTC by Kirby Zhou
Modified: 2012-06-20 06:23 UTC (History)
17 users (show)

Fixed In Version: libvirt-0.9.9-1.el6
Doc Type: Enhancement
Doc Text:
A very common question from users is how to "bridge" one of their host's ethernet devices so that virtual guests can be connected directly to the physical network (rather than through a libvirt virtual network). This RFE adds a simple virsh command to do exactly that. For example: virsh iface-bridge eth0 br0 will create a Linux host-bridge device, attach eth0 to it, and move all IP configuration information from eth0 to br0. You can then connect guests to the br0 interface: <interface type='bridge'> <source bridge='br0'/> </interface> This makes the instructions for using "bridge mode networking" orders of magnitude simpler. There is also an "iface-unbridge" command to revert the interface to its previous un-bridged state.
Clone Of:
Environment:
Last Closed: 2012-06-20 06:23:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description Kirby Zhou 2010-06-19 15:41:37 UTC
Description of problem:

RFE: Add a command to quickly setup a normal Bridge Networking for KVM like xenbr0.

libvirtd depends on network-bridge, but to setup Bridge Networking for KVM is too hardy. Please give us a simple command to do it.


For example:

~]# setup-bridge eth0
ifcfg-eth0 get modified and ifcfg-br@eth0 get created.
The network service automaticly restarted.

~]# setup-bridge -u eth0
ifcfg-eth0 get modified and ifcfg-br@eth0 get removed.
The network service automaticly restarted.

Comment 1 Subhendu Ghosh 2010-10-15 04:24:27 UTC
Moved for RHEL6 feature tracking

Comment 2 brandon theis 2011-02-23 23:55:51 UTC
this should also please verify driver support!

Comment 5 Laine Stump 2011-11-29 00:18:50 UTC
A command to satisfy this request has been added to virsh in upstream libvirt. It will be included with the next RHEL6 libvirt rebase.

commit 1ae8eed1b4740f1977f05235b47c820c7397e0f9
Author: Laine Stump <laine>
Date:   Mon Nov 7 11:15:58 2011 -0500

    virsh: add iface-bridge and iface-unbridge commands
    
    One of the top questions by libvirt users is how to create a host
    bridge device so that guests can be directly on the physical
    network. There are several example documents that explain how to do
    this manually, but following them often results in confusion and
    failure. virt-manager does a good job of creating a bridge based on an
    existing network device, but not everyone wants to use virt-manager.
    
    This patch adds a new command, iface-bridge that makes it just about
    as simple as possible to create a new bridge device based on an
    existing ethernet/vlan/bond device (including associating IP
    configuration with the bridge rather than the now-attached device),
    and start that new bridge up ready for action, eg:
    
        virsh iface-bridge eth0 br0
    
    For symmetry's sake, it also adds a command to remove a device from a
    bridge, restoring the IP config to the now-unattached device:
    
        virsh iface-unbridge br0
    
    During creation of the bridge, it's possible to specify whether or not
    the STP protocol should be started up on the bridge and, if so, how
    many seconds the bridge should squelch traffic from newly added
    devices while learning new topology (defaults are stp='on' and
    delay='0', which seems to usually work best for bridges used in the
    context of libvirt guests).

    There is also an option to not immediately start the bridge (and a
    similar option to not immediately start the un-attached device after
    destroying the bridge. Default is to start the new device, because in
    the case of iface-unbridge not starting is strongly discouraged as it
    will leave the system with no network connectivity on that interface
    (because it's necessary to destroy/undefine the bridge device before
    the unattached device can be defined), and it seemed better to make
    the option for iface-bridge behave consistently.

Comment 6 Kirby Zhou 2011-12-02 09:48:11 UTC
Good news
Does 'virsh iface-bridge' do modify scripts inside /etc/sysconfing/ ?

Comment 7 Laine Stump 2011-12-02 10:40:39 UTC
virsh iface-bridge uses the virInterface APIs to read the current config of an interface, creates the XML to describe a similar bridged interface, and writes that info back. The files modified will be /etc/sysconfig/network-scripts/ifcfg-($ethdevice|$brdevice).

Comment 9 zhpeng 2012-01-10 03:43:29 UTC
Test it with:
libvirt-0.9.9-1.el6.x86_64

Steps:

virsh # iface-bridge em1 br0 --no-stp
Created bridge em1 with attached device br0
Bridge interface br0 started

virsh # iface-unbridge  br0
Device em1 un-attached from bridge br0
Interface em1 started

network profile:
ifcfg-em1:
DEVICE=em1
HWADDR=78:2B:CB:9A:73:9B
ONBOOT=yes
BRIDGE=br0

ifcfg-br0:
DEVICE=br0
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=dhcp
STP=off
DELAY=0


Passed.

Comment 10 Laine Stump 2012-05-08 19:28:51 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
A very common question from users is how to "bridge" one of their host's ethernet devices so that virtual guests can be connected directly to the physical network (rather than through a libvirt virtual network). This RFE adds a simple virsh command to do exactly that. For example:

    virsh iface-bridge eth0 br0

will create a Linux host-bridge device, attach eth0 to it, and move all IP configuration information from eth0 to br0. You can then connect guests to the br0 interface:

   <interface type='bridge'>
      <source bridge='br0'/>
   </interface>

This makes the instructions for using "bridge mode networking" orders of magnitude simpler.

There is also an "iface-unbridge" command to revert the interface to its previous un-bridged state.

Comment 11 Kirby Zhou 2012-05-09 07:14:58 UTC
How about files: /etc/.../route-eth0, rule-eth0 eth0.route ?

(In reply to comment #10)
>     Technical note added. If any revisions are required, please edit the
> "Technical Notes" field
>     accordingly. All revisions will be proofread by the Engineering Content
> Services team.
> 
>     New Contents:
> A very common question from users is how to "bridge" one of their host's
> ethernet devices so that virtual guests can be connected directly to the
> physical network (rather than through a libvirt virtual network). This RFE adds
> a simple virsh command to do exactly that. For example:
> 
>     virsh iface-bridge eth0 br0
> 
> will create a Linux host-bridge device, attach eth0 to it, and move all IP
> configuration information from eth0 to br0. You can then connect guests to the
> br0 interface:
> 
>    <interface type='bridge'>
>       <source bridge='br0'/>
>    </interface>
> 
> This makes the instructions for using "bridge mode networking" orders of
> magnitude simpler.
> 
> There is also an "iface-unbridge" command to revert the interface to its
> previous un-bridged state.

Comment 13 errata-xmlrpc 2012-06-20 06:23:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html


Note You need to log in before you can comment on or make changes to this bug.