LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 03-18-2013, 03:47 PM   #1
asd0z
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Rep: Reputation: 0
Question VM network bridge


Hi all

How to make bridge for KVM virtual machine in Fedora/RHEL like in VMware Workstation?

Virtual machine must be in same network as host but have different MAC+IP. NAT is not ok.

Last edited by asd0z; 03-18-2013 at 03:54 PM.
 
Old 03-19-2013, 03:54 AM   #2
Air-Global
Member
 
Registered: Dec 2012
Location: The Netherlands
Distribution: Fedora 27 & CentOS 7
Posts: 62

Rep: Reputation: 8
Step one, add a bridge network.

ill use eth0 for all examples:

Create a copy of your eth0 file as br0:
Code:
$ cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-br0
Edit your original eth file for bridgeing:

Code:
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
change/add these lines:
Code:
NM_CONTROLLED="no" //might be needed, for me it works both ways
BRIDGE="br1"
Edit the new br file:
Code:
$ vi /etc/sysconfig/network-scripts/ifcfg-br0
Make sure you end up with it as follows:
Code:
DEVICE="br0"
MACADDR="YO:RE:MA:CH:ER:E!"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Bridge"
IPV4_FAILURE_FATAL="no"
restart your network service:
Code:
$ service network restart
Now that your host setup is done, lets set your KVM Setup:
Ill assume your KVM guest is running.

Edit your KVMGuests setup
Code:
$ virsh edit kvmGuestName
Add these lines (or replace your current network setup) & Make sure the slot on the last line is unique in your file
Code:
<interface type='bridge'>
  <mac address='52:54:00:xx:xx:xx'/>   //Write any unique to your nets mac
  <source bridge='br0'/>
  <model type='virtio'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> 
</interface>

Restart your guest and you are done

Last edited by Air-Global; 03-19-2013 at 03:56 AM.
 
Old 03-19-2013, 05:34 AM   #3
asd0z
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Original Poster
Rep: Reputation: 0
What MAC i should type here?
Quote:
MACADDR="YO:RE:MA:CH:ER:E!"
Did i understand correctly that 'host eth0' and 'virtual internal interface of kvmGuestName' will be in the same network?
 
Old 03-19-2013, 06:56 AM   #4
Air-Global
Member
 
Registered: Dec 2012
Location: The Netherlands
Distribution: Fedora 27 & CentOS 7
Posts: 62

Rep: Reputation: 8
Ah yes, that could have been clearer :P

The mac of your orriginal interface. It binds the bridge to the mac.
 
  


Reply

Tags
bridge, network, virtual


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] To bridge or not to bridge (network) Adol Linux - Newbie 2 02-03-2012 09:03 AM
Xen network-route AND network-bridge setup kwiksand Linux - Networking 1 08-22-2010 03:18 PM
network bridge / bond - slackware network init scripts Slax-Dude Slackware 1 07-17-2009 06:56 AM
Bridge simulating Network Lag, for developing network code for games intripoon Linux - Networking 18 10-27-2005 05:04 PM
network bridge Ryan450 Linux - Networking 1 08-26-2004 03:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 09:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration