[rtems-libbsd commit] doc: Add Qemu network setup

Sebastian Huber sebh at rtems.org
Thu Oct 1 06:05:50 UTC 2015


Module:    rtems-libbsd
Branch:    master
Commit:    613c34100e5f4ef8c3d4c63bc8749faae39a4df8
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=613c34100e5f4ef8c3d4c63bc8749faae39a4df8

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Oct  1 08:03:19 2015 +0200

doc: Add Qemu network setup

---

 libbsd.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/libbsd.txt b/libbsd.txt
index a436806..ebb766c 100644
--- a/libbsd.txt
+++ b/libbsd.txt
@@ -324,6 +324,55 @@ command supports the -m flag to set/get the multicast hostname of the
 mDNS resolver instance.  See also rtems_mdns_sethostname() and
 rtems_mdns_gethostname().
 
+== Qemu
+
+Use the following script to set up a virtual network with three tap devices
+connected via one bridge device.
+
+-------------------------------------------------------------------------------
+#!/bin/sh -x
+
+user=`whoami`
+interfaces=(1 2 3)
+
+tap=qtap
+bri=qbri
+
+case $1 in
+	up)
+		sudo -i brctl addbr $bri
+		for i in ${interfaces[@]} ; do
+			sudo -i tunctl -t $tap$i -u $user ;
+			sudo -i ifconfig $tap$i up ;
+			sudo -i brctl addif $bri $tap$i ;
+		done
+		sudo -i ifconfig $bri up
+		;;
+	down)
+		for i in ${interfaces[@]} ; do
+			sudo -i ifconfig $tap$i down ;
+			sudo -i tunctl -d $tap$i ;
+		done
+		sudo -i ifconfig $bri down
+		sudo -i brctl delbr $bri
+		;;
+esac
+-------------------------------------------------------------------------------
+
+Connect your Qemu instance to one of the tap devices, e.g.
+
+-------------------------------------------------------------------------------
+qemu-system-i386 -m 512 -boot a -cpu pentium3 \
+	-drive file=$HOME/qemu/pc386_fda,index=0,if=floppy,format=raw \
+	-drive file=fat:$HOME/qemu/hd,format=raw \
+	-net nic,model=e1000,macaddr=0e:b0:ba:5e:ba:11 \
+	-net tap,ifname=qtap1,script=no,downscript=no \
+	-nodefaults -nographic -serial stdio
+-------------------------------------------------------------------------------
+
+Make sure that each Qemu instance uses its own MAC address to avoid an address
+conflict (or otherwise use it as a test).
+
 == Issues and TODO
 
 * PCI support on x86 uses a quick and dirty hack, see pci_reserve_map().



More information about the vc mailing list