From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: Re: [PATCH]Change default network schema in network-bridge Date: Fri, 26 Jun 2009 16:33:50 +0100 Message-ID: <20090626153350.GE32509@redhat.com> References: <4A40630C.4010708@oracle.com> <20090623090158.GA6881@redhat.com> <19010.14945.628425.327154@mariner.uk.xensource.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <19010.14945.628425.327154@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: Zhigang Wang , xen-devel List-Id: xen-devel@lists.xenproject.org On Wed, Jun 24, 2009 at 03:38:25PM +0100, Ian Jackson wrote: > Daniel P. Berrange writes ("[Xen-devel] Re: [PATCH]Change default network schema in network-bridge"): > > These days my recommendation > > is for people to set '(network-script /bin/true)' and then just use their > > OS distributions network scripts to add a bridge device. > > This is definitely the best way of doing things. I've always thought > that the network-script thing was a terrible hack (and it's flaky > too). > > Perhaps we should keep the script, but change the defaults and the > documentation ? > > > http://wiki.libvirt.org/page/Networking#Bridged_networking_.28aka_.22shared_physical_device.22.29 > > Would you be able to resubmit (some of) that as a .txt file for > inclusion in the xen-unstable tree, or copy it to the Xen wiki ? > I'm not exactly sure of the authorship and copyright status so I'm > reluctant to just do that myself. I wrote initial content, the remainder is just bug fixes/tweaks too minor to be copyrightable. Here is a simplified text version that just covers the bridging setup, without the other libvirt specific bits Signed off by: Daniel P. Berrange Regards, Daniel Native OS bridge configuration ============================== The traditional "network-bridge" script attempts to modify existing active network interfaces to enable bridging. For non-trivial network configurations though this can be error prone, and the temporary disruption to network connectivity can upset some applications. This document outlines how to configure bridging using an OS' native network configuration files. Disabling Xen's network scripts ------------------------------- The first step is to check XenD's network bridge is disabled by editing /etc/xen/xend-config.sxp and changing the line (network-script network-bridge) To be (network-script /bin/true) Fedora/RHEL Bridging ==================== This outlines how to setup bridging using standard network initscripts present in Fedora or RHEL distros and their derivatives Disabling NetworkManager ------------------------ As of time of writing (Fedora 11) NetworkManager does not support bridging, so it is neccessary to disable it, and revert to "classic" network initscripts # chkconfig NetworkManager off # chkconfig network on # service NetworkManager stop # service network start NB, as an alternative to turning off NetworkManager, you can also add a line "NM_CONTROLLED=no" to the ifcfg-XXX scripts below Creating network initscripts ---------------------------- In the /etc/sysconfig/network-scripts directory it is necccessary to create 2 config files. The first (ifcfg-eth0) defines your physical network interface, and says that it will be part of a bridge: # cat > ifcfg-eth0 < ifcfg-br0 < /etc/sysconfig/iptables-forward-bridged # lokkit --custom-rules=ipv4:filter:/etc/sysconfig/iptables-forward-bridged # service libvirtd reload Alternatively, you can prevent bridged traffic getting pushed through the host's iptables rules completely. In /etc/sysctl.conf add # cat >> /etc/sysctl.conf <