 |
 |
 |
 |
| Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc. |

24th June 2011, 07:12 PM
|
|
Registered User
|
|
Join Date: Jun 2011
Posts: 3

|
|
|
Configuring bridged network with VMs
Hi all,
I'm trying to do something that seems like it ought to be very straightforward, but I can't figure it out and I can't find any FAQs or HowTos that seem to address my problem.
I have one physical computer with one physical network interface card. It is running Fedora 14. That computer is on my local network with an IP address of 192.168.1.150. My gateway address is 192.168.1.254. This system has full connectivity to all the other systems on my local network as well as the outside Internet.
I want to create 3 VMs on this host. I want the guest systems to run Fedora 14 as well. I want to assign the guest VMs IP addresses of 192.168.1.160, 192.168.1.170, and 192.168.1.180. I want each guest VM to have full connectivity to all the other systems on the 192.168.1.XXX network, and to the outside Internet.
I've been able to get the VMs built and working using NAT, but in that configuration they come up on a separate subnet (192.168.122.XXX). The VMs have full connectivity to each other, to the host system (192.168.1.150), and to the general Internet, but they cannot be accessed from any of the other systems on the 192.168.1.XXX network.
From my research I think I need to set up a bridged network instead of using NAT, but I have not been able to find a set of instructions that I can follow to successful completion. Can anyone either provide or point me to a really simple step-by-step guide to creating the network I need? Thanks for any assistance.
--Ken Weiss
|

25th June 2011, 10:20 AM
|
|
Registered User
|
|
Join Date: Oct 2008
Location: Poland
Posts: 49

|
|
|
Re: Configuring bridged network with VMs
Hi,
Yes exactly, you should use bridged network to achieve your assumptions, but you have not write what virtual machine are you using ?
|

25th June 2011, 11:21 PM
|
|
Registered User
|
|
Join Date: May 2008
Location: Brisbane, Australia
Posts: 91

|
|
|
Re: Configuring bridged network with VMs
__________________
------------------------------------------
A lost packet on the Internet of life
|

26th June 2011, 01:37 AM
|
|
Registered User
|
|
Join Date: Jun 2011
Posts: 3

|
|
|
Re: Configuring bridged network with VMs
@Raffaello22 - I'm using QEMU, and both the host and all the VMs are Fedora 14.
@rmbrady - Thanks for the pointer. However, the first thing it says is, "Bridged networking (also known as physical device sharing) is used for dedicating a physical device to a virtual machine. Bridging is often used for more advanced setups and on servers with multiple network interfaces." I only have a single physical device (network card), and I want to share it among 3 VMs and a physical host. From what I can understand, bridging would be useful if I had four network cards in my host, so I could dedicate one to the host and one to each of my 3 VMs. But that's not my configuration. Although I guess it wouldn't cost that much to make it so...
|

26th June 2011, 04:29 AM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 4,975

|
|
|
Re: Configuring bridged network with VMs
No, bridged networking is what you want, if I understand the question. You want all Virtual Machines, as well as the host, to be on the same subnet, so that if your host was, for example, 192.168.1.7, one VM would 192.168.1.8 and so on.
Assuming this is what you want, I have an old page that talks about doing it from command line. (I think, though am not sure, that even if you use the GUI tools, you still have to set up the tap networking first.)
At any rate, my page's url is
http://home.roadrunner.com/~computer...centoskvm.html
I think most of the instructions will still hold (look for the section on bridged networking.)
The difference in a nutshell.
Nat is what qemu and VirtualBox do by default. They put the VMs on their own subnet, where they can reach the Internet but can't be reached. Bridging is what you use when you want the machine to be on the same LAN as the host.
|

30th June 2011, 05:30 PM
|
|
Registered User
|
|
Join Date: Jun 2011
Posts: 3

|
|
|
Re: Configuring bridged network with VMs
@smr - Thanks! That was a great starting point. I'm still not there, but I can now at least believe that it's possible to do what I want with the equipment I have. Here's another helpful reference:
http://forums.fedoraforum.org/archiv.../t-206548.html
One key thing I missed is that I need to create a tapN interface for each VM. I think I have the bridge and the first tap interface properly configured on the host now:
[root@pnut kweiss]# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
DNS1=192.168.1.254
GATEWAY=192.168.1.254
IPADDR=192.168.1.150
NETMASK=255.255.255.0
ONBOOT=yes
[root@pnut kweiss]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
#BOOTPROTO=none
#DNS1=192.168.1.254
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
USERCTL=no
HWADDR=10:78 2:7B:6F:3A
#IPADDR=192.168.1.150
#NETMASK=255.255.255.0
GATEWAY=192.168.1.254
PREFIX=24
BRIDGE=br0
[root@pnut kweiss]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.1078d27b6f3a yes eth0
tap0
vnet2
virbr0 8000.fe5400bfbfe9 yes vnet0
vnet1
vnet3
[root@pnut kweiss]# ifconfig
br0 Link encap:Ethernet HWaddr 10:78 2:7B:6F:3A
inet addr:192.168.1.150 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::1278:d2ff:fe7b:6f3a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:62143475 errors:0 dropped:0 overruns:0 frame:0
TX packets:113055395 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3922912212 (3.6 GiB) TX bytes:148975478657 (138.7 GiB)
eth0 Link encap:Ethernet HWaddr 10:78 2:7B:6F:3A
inet6 addr: fe80::1278:d2ff:fe7b:6f3a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:71962601 errors:1 dropped:0 overruns:0 frame:1
TX packets:113175632 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17997952296 (16.7 GiB) TX bytes:149486499582 (139.2 GiB)
Interrupt:43 Base address:0xe000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:42352 errors:0 dropped:0 overruns:0 frame:0
TX packets:42352 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:40825138 (38.9 MiB) TX bytes:40825138 (38.9 MiB)
tap0 Link encap:Ethernet HWaddr 4E:55:86:05:30:61
inet6 addr: fe80::4c55:86ff:fe05:3061/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:288502 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Unfortunately, the system is now located about 110 miles from me, and I can't seem to get a GUI interface to the Fedora VM manager working from my Macintosh laptop. When I tried to reset the IP address and gateway for the VM from home, I ended up with no network connection to the VM at all. I think I'm going to have to take a long drive to reconfigure the VMs to use the tap interfaces, unless someone can help explain what I need to do with the XML file that defines the VM to point it at the tap0 interface. I followed the guidelines I found for bridging, but this isn't working:
<interface type='bridge'>
<source bridge='br0'/>
<target dev='tap0'/>
<mac address='52:54:00:d1:ec:25'/>
</interface>
Last edited by cckweiss; 30th June 2011 at 05:51 PM.
Reason: try to fix formatting
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 01:24 (Sunday, 19-05-2013)
|
|
 |
 |
 |
 |
|
|