Re: Setting up network for KVM guests

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

 



On 05/26/2011 03:40 PM, c.monty@xxxxxx wrote:
Hello!
I have installed KVM/QEMU on my LMDE (Linux Mint Debian Edition) system.

On this webpage I found some instructions howto setup the network:
http://www.linux-kvm.org/page/Networking

My first question is:
For a public bridge, should I configure /etc/network/interfaces in order to create the bridge static.
Or should I use a script to create a bridge dynamically when the virtual machine starts.

I doubt there's a correct answer. I create the bridges I use statically at boot time and create bridge taps on demand when I launch VMs (probably because I always found the VMWare bridges appealing). If you want to have physical network access for VMs or a stable routing environment for them at launch or host services like dhcpd/pxe/etc to support them then I recommend static bridges that you consider part of the host environment.

Second question:
I made some tests with this script that is shown in section
public bridge ->  Solution 2: manual:

#!/bin/sh
set -x

switch=br0

if [ -n "$1" ];then
         /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t $1
         /usr/bin/sudo /sbin/ip link set $1 up
         sleep 0.5s
         /usr/bin/sudo /usr/sbin/brctl addif $switch $1
         exit 0
else
         echo "Error: no interface specified"
         exit 1
fi

When I debug this script I can see that it always ends up in "Error: no interface specified":
bash -x /usr/local/bin/networkbridge_setup.sh
+ set -x
+ switch=br0
+ '[' -n '' ']'
+ echo 'Error: no interface specified'
Error: no interface specified
+ exit 1


Why is that?

It looks like $1 must be empty because the script was run with no command line arguments/parameters.

--
David.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux