Hello everyone,
I'm learning about bridged networking and how it is applied to virtual environments (bypassing all the automation provided by libvirtd etc) . I have a question regarding ip configuration for the virtual bridge.
Let's say I have a host (my machine) where I want to run 3 VMs bridged to my home network (thru eth0). I have a DHCP server running on my DSL router, and I have dhcp enabled on my 3 VMs so they all should get a lease from the DHCP.
As far as a I know these are the raw steps needed to accomplish this:
1- create br0 2- remove current ip address from eth0 3- enslave eth0 to br0 4- create tap devices 5- attach tap devices to br0 6- assign tap devices to every VM
As you can see I haven't assigned an ip address to the virtual bridge (br0). Why is it that (on almost any site that I visit with this setup) they always end up assigning an ip address to br0?
Thanks in advance! Jorge
On 01/17/2012 02:57 PM, Jorge Fábregas wrote:
Hello everyone,
I'm learning about bridged networking and how it is applied to virtual environments (bypassing all the automation provided by libvirtd etc) . I have a question regarding ip configuration for the virtual bridge.
Let's say I have a host (my machine) where I want to run 3 VMs bridged to my home network (thru eth0). I have a DHCP server running on my DSL router, and I have dhcp enabled on my 3 VMs so they all should get a lease from the DHCP.
As far as a I know these are the raw steps needed to accomplish this:
1- create br0 2- remove current ip address from eth0 3- enslave eth0 to br0 4- create tap devices 5- attach tap devices to br0 6- assign tap devices to every VM
As you can see I haven't assigned an ip address to the virtual bridge (br0). Why is it that (on almost any site that I visit with this setup) they always end up assigning an ip address to br0?
Thanks in advance! Jorge _______________________________________________ virt mailing list virt@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/virt
There should be no reason to use tap devices as the bridge device can be assigned as a network controller like so:
<interface type='bridge'> <mac address='52:54:00:22:92:24'/> <source bridge='br0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <interface type='bridge'> <mac address='52:54:00:7c:0c:db'/> <source bridge='br1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </interface>
Using virtmanager to create the network interface would add the above tags and attributes to the guest's config file by creating a Bridge type interface.
Assign the host's IP addresses to the brX devices:
br0 Link encap:Ethernet HWaddr BC:AE:C5:BE:07:DD inet addr:ww.xxx.yyy.zz Bcast:ww.xxx.yyy.yy Mask:255.255.255.240 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:28384 errors:0 dropped:0 overruns:0 frame:0 TX packets:16265 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:34899139 (33.2 MiB) TX bytes:2018000 (1.9 MiB)
It would look like eth0 on the guest.
And the guest IP address to ethX:
eth0 Link encap:Ethernet HWaddr 52:54:00:1B:A4:E6 inet addr:ww.xxx.yyy.xz Bcast:ww.xxx.yyy.yy Mask:255.255.255.240 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3291 errors:0 dropped:0 overruns:0 frame:0 TX packets:2140 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:995099 (971.7 KiB) TX bytes:414119 (404.4 KiB) Interrupt:11
On the host ifcfg-br0:
DEVICE="br0" TYPE="Bridge" BOOTPROTO="none" ONBOOT="yes" DELAY=0 GATEWAY="ww.xxx.yyy.zz" IPADDR="ww.xxx.yyy.zx" NETMASK="255.255.255.240" IPV6INIT=no
On the host ifcfg-eth0:
DEVICE="eth0" HWADDR="00:00:00:00:00:00" ONBOOT="yes" BRIDGE="br0" IPV6INIT=no
On the guest ifcfg-eth0:
DEVICE="eth0" BOOTPROTO="none" HWADDR="52:54:00:22:92:24" ONBOOT="yes" IPADDR="ww.xxx.yyy.xz" NETMASK="255.255.255.240" GATEWAY="ww.xxx.yyy.zx" DNS1="ww.xxx.yyy.xx"
Emmett
On Tue, 17 Jan 2012 18:57:14 -0400 Jorge Fábregas wrote:
Why is it that (on almost any site that I visit with this setup) they always end up assigning an ip address to br0?
I've noticed that too, so I just give my bridges static IPs. I've never known if the bridge can get an IP from the DHCP server or not, so I've just avoided doing it.
On 01/18/2012 06:24 AM, Tom Horsley wrote:
On Tue, 17 Jan 2012 18:57:14 -0400 Jorge Fábregas wrote:
Why is it that (on almost any site that I visit with this setup) they always end up assigning an ip address to br0?
I've noticed that too, so I just give my bridges static IPs. I've never known if the bridge can get an IP from the DHCP server or not, so I've just avoided doing it.
Yes, a bridge -can- get an IP from DHCP. That's what I've been using forever. Here is my bridge config on one of my virt. hosts ################################### [root@foobar network-scripts]# cat ifcfg-br0 DEVICE=br0 TYPE=Bridge BOOTPROTO=dhcp ONBOOT=yes DELAY=0 [root@foobar network-scripts]# ################################### [root@foobar network-scripts]# cat ifcfg-em1 DEVICE=em1 BOOTPROTO=dhcp TYPE=Ethernet ONBOOT=yes IPV6INIT=no NM_CONTROLLED=no USERCTL=no PEERDNS=yes PEERROUTES=yes BRIDGE=br0 [root@foobar network-scripts]# ###################################
hth,
/kashyap
virt mailing list virt@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/virt
On 01/17/2012 11:57 PM, Jorge Fábregas wrote:
As you can see I haven't assigned an ip address to the virtual bridge (br0). Why is it that (on almost any site that I visit with this setup) they always end up assigning an ip address to br0?
How are you going manage the host if it doesn't have an IP address? After all you removed the IP from eth0 above.
Regards, Dennis
On 01/18/2012 08:31 AM, Dennis Jacobfeuerborn wrote:
How are you going manage the host if it doesn't have an IP address? After all you removed the IP from eth0 above.
Yep, I see that but thought perhaps you would have a separate NIC just for host management. I decided to ask here to see if there was any particular technical reason behind it (other than to manage the host). Apparently that's the main reason for assigning an ip to your virtual switch.
Regards, Jorge
hello,
after upgrading to F17, my guest OS doesn't start. i get the message...
"viewer connection to hypervisor host got refused or disconnected"
in virt-manager. libvirtd is running.
virt-manager.log shows...
[Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:607) Connection managed save support: True [Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:189) Using libvirt API for netdev enumeration [Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:229) Using libvirt API for mediadev enumeration [Mon, 09 Jul 2012 16:35:35 virt-manager 23073] DEBUG (details:535) Showing VM details: <vmmDomain object at 0x2f71a50 (virtManager+domain+vmmDomain at 0x3011420)> [Mon, 09 Jul 2012 16:35:35 virt-manager 23073] DEBUG (engine:471) window counter incremented to 2 [Mon, 09 Jul 2012 16:35:36 virt-manager 23073] DEBUG (engine:1021) Starting vm 'winXP' [Mon, 09 Jul 2012 16:35:36 virt-manager 23073] DEBUG (asyncjob:124) Creating async job for function cb=<function tmpcb at 0x2f98488> [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:1075) Starting connect process for proto=vnc trans=None connhost=localhost connuser=None connport=None gaddr=127.0.0.1 gport=5900 gsocket=None [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:373) VNC connecting to localhost:5900 [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:958) Viewer disconnected [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (manager:184) Closing manager [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (details:552) Closing VM details: <vmmDomain object at 0x2f71a50 (virtManager+domain+vmmDomain at 0x3011420)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:548) Leaked <vmmConsolePages object at 0x2f7e050 (virtManager+console+vmmConsolePages at 0x357ef00)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:548) Leaked <VNCViewer object at 0x35a7b90 (GObject at 0x3782400)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:550) Exiting app normally.
thanks, sam
On 07/10/2012 02:41 AM, sam chan wrote:
hello,
after upgrading to F17, my guest OS doesn't start. i get the message...
"viewer connection to hypervisor host got refused or disconnected"
I guess the VM is down as well.
in virt-manager. libvirtd is running.
virt-manager.log shows...
Can you provide the libvirt logs too?
[Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:607) Connection managed save support: True [Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:189) Using libvirt API for netdev enumeration [Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:229) Using libvirt API for mediadev enumeration [Mon, 09 Jul 2012 16:35:35 virt-manager 23073] DEBUG (details:535) Showing VM details: <vmmDomain object at 0x2f71a50 (virtManager+domain+vmmDomain at 0x3011420)> [Mon, 09 Jul 2012 16:35:35 virt-manager 23073] DEBUG (engine:471) window counter incremented to 2 [Mon, 09 Jul 2012 16:35:36 virt-manager 23073] DEBUG (engine:1021) Starting vm 'winXP' [Mon, 09 Jul 2012 16:35:36 virt-manager 23073] DEBUG (asyncjob:124) Creating async job for function cb=<function tmpcb at 0x2f98488> [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:1075) Starting connect process for proto=vnc trans=None connhost=localhost connuser=None connport=None gaddr=127.0.0.1 gport=5900 gsocket=None [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:373) VNC connecting to localhost:5900 [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:958) Viewer disconnected [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (manager:184) Closing manager [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (details:552) Closing VM details: <vmmDomain object at 0x2f71a50 (virtManager+domain+vmmDomain at 0x3011420)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:548) Leaked <vmmConsolePages object at 0x2f7e050 (virtManager+console+vmmConsolePages at 0x357ef00)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:548) Leaked <VNCViewer object at 0x35a7b90 (GObject at 0x3782400)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:550) Exiting app normally.
thanks, sam
virt mailing list virt@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/virt
Dor,
libvirtd.log has...
2012-07-10 21:39:29.021+0000: 14838: info : libvirt version: 0.9.11.4, package: 3.fc17 (Fedora Project, 2012-06-28-13:50:28, x86-05.phx2.fedoraproject.org) 2012-07-10 21:39:29.021+0000: 14838: error : qemuMonitorIORead:522 : Unable to read from monitor: Connection reset by peer
in /var/log/messages...
Jul 10 14:30:41 localhost libvirtd[4081]: 2012-07-10 21:30:41.389+0000: 4081: error : qemuMonitorIO:612 : internal error End of file from monitor
not sure these are that telling.
thanks.
On Tue, 10 Jul 2012, Dor Laor wrote:
On 07/10/2012 02:41 AM, sam chan wrote:
hello,
after upgrading to F17, my guest OS doesn't start. i get the message...
"viewer connection to hypervisor host got refused or disconnected"
I guess the VM is down as well.
in virt-manager. libvirtd is running.
virt-manager.log shows...
Can you provide the libvirt logs too?
[Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:607) Connection managed save support: True [Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:189) Using libvirt API for netdev enumeration [Mon, 09 Jul 2012 16:35:33 virt-manager 23073] DEBUG (connection:229) Using libvirt API for mediadev enumeration [Mon, 09 Jul 2012 16:35:35 virt-manager 23073] DEBUG (details:535) Showing VM details: <vmmDomain object at 0x2f71a50 (virtManager+domain+vmmDomain at 0x3011420)> [Mon, 09 Jul 2012 16:35:35 virt-manager 23073] DEBUG (engine:471) window counter incremented to 2 [Mon, 09 Jul 2012 16:35:36 virt-manager 23073] DEBUG (engine:1021) Starting vm 'winXP' [Mon, 09 Jul 2012 16:35:36 virt-manager 23073] DEBUG (asyncjob:124) Creating async job for function cb=<function tmpcb at 0x2f98488> [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:1075) Starting connect process for proto=vnc trans=None connhost=localhost connuser=None connport=None gaddr=127.0.0.1 gport=5900 gsocket=None [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:373) VNC connecting to localhost:5900 [Mon, 09 Jul 2012 16:35:37 virt-manager 23073] DEBUG (console:958) Viewer disconnected [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (manager:184) Closing manager [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (details:552) Closing VM details: <vmmDomain object at 0x2f71a50 (virtManager+domain+vmmDomain at 0x3011420)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:548) Leaked <vmmConsolePages object at 0x2f7e050 (virtManager+console+vmmConsolePages at 0x357ef00)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:548) Leaked <VNCViewer object at 0x35a7b90 (GObject at 0x3782400)> [Mon, 09 Jul 2012 16:35:39 virt-manager 23073] DEBUG (engine:550) Exiting app normally.
thanks, sam
virt mailing list virt@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/virt
On 07/10/2012 05:55 PM, sam chan wrote:
Dor,
libvirtd.log has...
2012-07-10 21:39:29.021+0000: 14838: info : libvirt version: 0.9.11.4, package: 3.fc17 (Fedora Project, 2012-06-28-13:50:28, x86-05.phx2.fedoraproject.org) 2012-07-10 21:39:29.021+0000: 14838: error : qemuMonitorIORead:522 : Unable to read from monitor: Connection reset by peer
in /var/log/messages...
Jul 10 14:30:41 localhost libvirtd[4081]: 2012-07-10 21:30:41.389+0000: 4081: error : qemuMonitorIO:612 : internal error End of file from monitor
not sure these are that telling.
thanks.
How about /var/log/libvirt/qemu/<your-vm-name>.log? That contains command line error output from qemu, which should hopefully have more info.
- Cole
now fixed.
i used solution here....
http://forums.gentoo.org/viewtopic-t-923348-start-0.html
thanks, sam