Fedora Linux Support Community & Resources Center
  #1  
Old 9th December 2012, 01:20 PM
asd0z Offline
Registered User
 
Join Date: Dec 2012
Location: Earth
Posts: 2
linuxfirefox
KVM bridge network

Hi, everyone

I need following configuration:

- Host KVM machine Fedora 17 has one h/w interface and static IP 10.0.0.100, GW 10.0.0.1.

- VM must have two virtual adapters.

- First VM adapter is NAT (192.168.120.xx). It works good "from the box".

- Second VM adapter must be in host network environment and get IP by DHCP (for example 10.0.0.130).


I have tried many variants with /etc/sysconfig/network-scripts but bridge doesn't work .
Reply With Quote
  #2  
Old 9th December 2012, 08:42 PM
Dutchy Offline
Registered User
 
Join Date: Aug 2011
Posts: 928
linuxfirefox
Re: KVM bridge network

Do you use virt-manager?
You can easily create virtual networks with it.
Reply With Quote
  #3  
Old 10th December 2012, 04:56 AM
asd0z Offline
Registered User
 
Join Date: Dec 2012
Location: Earth
Posts: 2
linuxfirefox
Re: KVM bridge network

Quote:
Originally Posted by Dutchy View Post
Do you use virt-manager?
You can easily create virtual networks with it.
Yes i tried to. But it fails with error at last step. So i experiment with existing VM and manually created files.

I think i misunderstand what interfaces i must get at the end. Can you explain me network schema in my case? I think i create wrong things.
Reply With Quote
  #4  
Old 10th December 2012, 05:26 AM
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,553
linuxfirefox
Re: KVM bridge network

I use bridges for KVM F17, but no - virtmanager isn't much help. It doesn't have any nice features for bridges.
Also I don't believe that /etc/sysconfig/network-scripts is effective unless you copy or link the results into /etc/sysconfig/networking/devices

sudo yum -y install bridge-utils

Use 'network.service' and not 'NetworkManager.service' for network configs.

My LAN is 192.168.42.*
I create a bridge called 'br0'
kvm host if 'hypoxylon'
domain is '.localdomain'


Here are the files under /etc/sysconfig/networking/devices
-rw-r--r--. 3 root root 97 Dec 7 02:25 ifcfg-br0
-rw-r--r--. 3 root root 375 Dec 7 02:25 ifcfg-p20p1

ifcfg-br0:
Quote:
[stevea@hypoxylon devices]$ cat ifcfg-br0
BOOTPROTO=dhcp
DHCP_HOSTNAME=hypoxylon.localdomain
IPV6INIT=no
ONBOOT=yes
TYPE=Bridge
USERCTL=no
This is the local interface on hypoxylon
Quote:
[stevea@hypoxylon devices]$ cat ifcfg-p20p1
UUID="4d6aac3c-fc58-43cf-a314-b142cac2bdb1"
NM_CONTROLLED=no
HWADDR=00:1B:21:59:64:F1
BOOTPROTO=dhcp
ONBOOT=yes
#--
# override
NM_CONTROLLED=no
BOOTPROTO=dhcp
ONBOOT=yes
# new for bridge
BRIDGE=br0
DEFROUTE="yes"
DELAY=0
DHCP_HOSTNAME=hypoxylon.localdomain
IPV4_FAILURE_FATAL="yes"
IPV6INIT=yes
MTU=1500
PEERDNS=yes
PEERROUTES="yes"
PREFIX=24
TYPE=Ethernet
USERCTL=yes
#--
I think I could clean the above up, but ... no time.
Some of the non-obvious junk like PEERDNS seems to be necessary


Then in virt-manager when you create a virtual-machine, select the VM's network as
"Specify Virtual device name", and select "br0" (your bridge name) as the "Bridge name".

Then the VMs show up on the local net, can DHCP there, just like any real system.

======

In the past the bridge was dramatically faster performance than the forwarding method, but that's no longer true. There is no great speed difference, but of course it's much more convenient to have the VMs participate on the LAN.

This may help
http://www.linux-kvm.org/page/Networking
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe

Last edited by stevea; 10th December 2012 at 05:31 AM.
Reply With Quote
Reply

Tags
bridge, ifcfg, kvm, network

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Bridge reidras Servers & Networking 0 11th April 2010 11:36 PM
Network bridge Keldorn Servers & Networking 1 4th December 2009 01:14 AM
Network bridge jameswalker Servers & Networking 3 11th March 2008 09:12 AM
network bridge setting up bridge-utils brw02005 Servers & Networking 0 28th March 2007 11:08 PM
Network Bridge dio Servers & Networking 2 27th February 2006 08:09 PM


Current GMT-time: 10:32 (Wednesday, 23-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat