>>> Damian Brasher wrote:
>
> don't use macaddr=23:23:23:00:00:01 use something sensible - I used a
> VMware set of fictitious mac's (from a different LAN entirely) and
> increased the value of one byte, i.e 00:50:56:C0:00:F3 seems that Qemu is
> intelligent enough to realise I was making up very unreal mac's.
>
> All working perfectly - running three bridged VM's with no packet loss :-)
For completeness use a variation to suite of this to initiate many VM's
all appearing on the LAN the host is on, this should get most people up
and running with a basic 64bit host machine / root setup:
#!/bin/bash
/usr/local/bin/qemu-system-x86_64 -kernel-kqemu -cdrom images/boot.iso \
-boot c -net nic,vlan=0,macaddr=00:50:56:00:C0:F1 -localtime -m 512m\
-net tap,vlan=0,ifname=tap0,script=/etc/kqemu/qemu-ifup images/vdisk01.img &
exit 0
for each new machine:-
Increase both instances of vlan=$ by 1
Increase vdisk0$ by 1
Increase tap$ by 1
and increase the 1st (or 6th octet) mac byte by 1 i.e. F$
Initial config below:
#!/bin/sh
# Setup the bridge
brctl addbr br0
# Add host ethernet adapter to the bridge
brctl addif br0 eth0
# Remove IP address from host ethernet device
ifconfig eth0 0.0.0.0 up
# Grab an IP address from DHCP for the bridge
dhclient br0
# Add the kqemu module
modprobe kqemu
I have disk images with RHEL 5 32bit (64bit should work) machines and
launch them using this script (see above):
#!/bin/bash
/usr/local/bin/qemu-system-x86_64 -kernel-kqemu -cdrom images/boot.iso \
-boot c -net nic,vlan=0,macaddr=00:50:56:00:C0:F1 -localtime -m 512m\
-net tap,vlan=0,ifname=tap0,script=/etc/kqemu/qemu-ifup images/vdisk01.img &
exit 0
The script to bind is (located in and named /etc/kqemu/qemu-ifup:
#!/bin/bash
BRIF=br0
echo "Connecting interface $1 to bridge $BRIF"
/sbin/ifconfig $1 0.0.0.0 promisc up
/usr/sbin/brctl addif $BRIF $1
Versions:
qemu 0.9.0 (from source)
kqemu 1.3.0pre11 (from source)
kernel 2.6.18-8.1.8.el5 SMP 2 x apparent CPU due to HT enable no VT
Next thing is to build in user mode and test different platforms inc 64bit
VM's.
I should expand this to a mini HOWTO with install, package and build
instructions for this and other platforms:)
Cheers Damian
--
Damian Brasher
www.interlinux.co.uk
All mail scanned by clam-av
http://www.clamav.net/