[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] Bridged Network, Fedora 16 and Network Manager



On 01/19/2012 11:58 PM, Eric Mesa wrote:
I'm using:
 virt-manager 0.9.0
Fedora 16
KDE 4.7.4
network manager 0.9.2-1

I want to have bridged connections so my VMs can be on the same network segment as the host. I used the instructions on here: http://www.linux-kvm.com/content/bridged-networking-virt-manager-083 When I did that, it made my ethernet connection go away. It seemed to freeze up, so I stopped the process. After that I had no ethernet connection so I had to go into network manager and add it back in. When I tried it again, I once again lost my ethernet connection.


Once you put an ethernet into a bridge, NetworkManager will never see it again. NM in F16 is smart enough to *ignore* bridge devices, and ethernets attached to bridges, but that's as far as it goes.


(Of course, the reason that you were no longer able to communicate out the ethernet after the change could be because of the absence of DEVICE in your ifcfg-br0 file. I'm not sure what the bridge device will be called if you don't specify it, but if it doesn't match what's in the BRIDGE= line of ifcfg-eth0, definitely your networking will be notworking.)

So I looked around on Linuxquestions.org and found instructions to do the following:

create /etc/sysconfig/network-scripts/ifcfg-br0 by copying it from /etc/sysconfig/network-scripts/ifcfg-eth0 then edit both files to match what you need, something like I have listed below


/etc/sysconfig/network-scripts/ifcfg-br0
Code:
DEVICE="br0"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=static
IPADDR=192.168.10.40
GATEWAY=192.168.10.1
DELAY=0

You might want to add "STP=on" to that (otherwise DELAY=0 has no meaning). Unless your ethernet is connected to a managed switch that forbids STP packets coming from your port (some admins put a rule on the ports that shuts them down if they detect STP packets. grumble grumble).


/etc/sysconfig/network-scripts/ifcfg-eth0
Code:
DEVICE="eth0"
ONBOOT=yes
TYPE=Ethernet
HWADDR=00:12:13:14:AB:CD
BRIDGE=br0
Then do 'service network restart'

On my computer instead of DEVICE it has NAME.  So I set it up like this:

NAME and DEVICE are not the same thing. NAME is just a descriptive bit of text, while DEVICE is the actual name of the device in the kernel.


cat ifcfg-br0
TYPE=Bridge
BOOTPROTO=none
IPADDR0=192.168.1.17
PREFIX0=24
GATEWAY0=192.168.1.1
DNS1=192.168.1.7
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=br0
ONBOOT=yes


When I put the BRIDGE=br0 into my eth0, it stopped working correctly. What do I have to do to get this set up correctly?


One other question - would I need to set up a brX for each VM?

No. As a matter of fact you *can't* do that. For the type of networking you're using (called "bridged mode" in most documentation), the bridge device needs to have a physical device directly attached to it, and each physical device can only be attached to a single bridge, so you would need an extra physical device for each bridge. Anyway, a bridge device can have 1024 devices attached to it; counting the one physical device, you could attach 1023 guest interfaces to a single bridge (not that you'd get stellar performance, but that's the limit).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]