I use a modification to rc.inet1 and rc.inet1.conf which allows for the configuration of a network bridge of your ethernet card and the tap interface used by VDE.
See
http://connie.slackware.com/~alien/rc_scripts/bridging/ for the patch, example use inside rc.inet1.conf can be found there as well.
My own server where I run several VM's in parallel I have the following lines in my rc.inet1.conf - all it does at boot is to setup a bridge and add my eth0 network interface to the bridge. The tap interface does not get added until later when it is actually needed. You see that I commented out the eth0 configuration:
Code:
# Config information for eth0:
#IPADDR[0]="192.168.0.1"
#NETMASK[0]="255.255.255.0"
#USE_DHCP[0]=""
#DHCP_HOSTNAME[0]=""
# Config information for br0:
IFNAME[1]="br0"
BRNICS[1]="eth0"
IPADDR[1]="192.168.0.1"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
Setting up the tap interface so that multiple virtual machines can be made part of the network subnet of the host, is not hard. If you use my
rc.vdenetwork script then that script takes care of adding the tap interface to the bridge when the vde_switch is created.
Add a call to my
rc.vdenetwork script to rc.local like with these lines:
Code:
# Start the VDE network layer:
if [ -x /etc/rc.d/rc.vdenetwork ]; then
echo "Starting VDE: /etc/rc.d/rc.vdenetwork start"
/etc/rc.d/rc.vdenetwork start
fi
Inside rc.vdenetwork, you have to set
Code:
NETWORKTYPE="bridge"
to use the bridge. Also, check the variable assignment
TAP_DEV=kvm0 because that means the tap interface is going to be created with the name "kvm0" instead of the default "tap0".
When at last you start qemu, you have to add these parameters so that it uses this kvm0 tap interface (and your qemu package has to be compiled with vde support, like my own packages for
qemu and
qemu-kvm):
Code:
-net vde,sock=/var/run/kvm0.ctl,vlan=0 -net nic,model=virtio,vlan=0
Note that I specified a "virtio" network interface which gives the VM a very fast and efficient network card (supported in Slackware of course) but you can also use a normal network card (a "e1000" card is the default if you do not specify a name).
Eric