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

Bridge configuration for KVM



Hi all!

I am trying to boot a KVM virtual machine using the following init script:

----------------------------------------------------------------------------
root@ss01:~# cat /etc/init.d/vm_start
#!/bin/bash

#
# Variables
#

KVM=/usr/bin/kvm
DISK_PATH=/space/vms

#
# Main
#

$KVM -hda $DISK_PATH/ratatoskr.img -m 512 -boot c -smp 2 -net \
 nic,vlan=0,macaddr=00:16:3e:00:00:31 -net tap -daemonize -vnc :1 \
 -k es -localtime -monitor telnet:localhost:4001,server,nowait \
 -serial telnet:localhost:4041,server,nowait
----------------------------------------------------------------------------


But when executing manually I obtain the following error message:

root@ss01:~# /etc/init.d/vm_start
can't add tap0 to bridge eth1: Operation not supported


In another machine I'm using KVM with a single network interface and I
don't have these error messages. It would seem the problem is in which
bridge is not on default gateway [1], that it would be consistent with
the network configuration that I am using:

----------------------------------------------------------------------------
root@ss01:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
# auto eth0
# iface eth0 inet dhcp

auto br0
iface br0 inet static
         address 10.1.0.49
         netmask 255.255.0.0
         network 10.1.0.0
         broadcast 10.1.255.255
         bridge_ports eth0
         bridge_stp off
         bridge_maxwait 5

auto eth1
iface eth1 inet static
         address 10.3.0.49
         netmask 255.255.0.0
         network 10.3.0.0
         broadcast 10.3.255.255
         gateway 10.3.0.5
----------------------------------------------------------------------------

in accordance with script qemu-ifup:

----------------------------------------------------------------------------
root@ss01:~# cat /etc/qemu-ifup
#!/bin/sh

# DGB - 20090106
#sudo -p "Password for $0:" /sbin/ifconfig $1 172.20.0.1

/sbin/ifconfig $1 0.0.0.0 promisc up
/usr/sbin/brctl addif br0 $1
sleep 2
----------------------------------------------------------------------------

I suppose that perhaps, modifying this script, I could boot the VM
mantaining bridge on eth0 and with default gateway on eth1. Somebody
could guide to me in how would have to configure the script to obtain
this result? 

Thanks in advance 

Regards,
Daniel

[1] https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/125302
-- 
Fingerprint: BFB3 08D6 B4D1 31B2 72B9  29CE 6696 BF1B 14E6 1D37
Powered by Debian GNU/Linux Squeeze - Linux user #188.598

Attachment: signature.asc
Description: Digital signature


Reply to: