Changeset 613c341 in rtems-libbsd for libbsd.txt


Ignore:
Timestamp:
Oct 1, 2015, 6:03:19 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, freebsd-9.3, 4a77611a223ea883fb548679b516d326a020d447
Children:
e78b3dc
Parents:
556a07c
Message:

doc: Add Qemu network setup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libbsd.txt

    r556a07c r613c341  
    324324mDNS resolver instance.  See also rtems_mdns_sethostname() and
    325325rtems_mdns_gethostname().
     326
     327== Qemu
     328
     329Use the following script to set up a virtual network with three tap devices
     330connected via one bridge device.
     331
     332-------------------------------------------------------------------------------
     333#!/bin/sh -x
     334
     335user=`whoami`
     336interfaces=(1 2 3)
     337
     338tap=qtap
     339bri=qbri
     340
     341case $1 in
     342        up)
     343                sudo -i brctl addbr $bri
     344                for i in ${interfaces[@]} ; do
     345                        sudo -i tunctl -t $tap$i -u $user ;
     346                        sudo -i ifconfig $tap$i up ;
     347                        sudo -i brctl addif $bri $tap$i ;
     348                done
     349                sudo -i ifconfig $bri up
     350                ;;
     351        down)
     352                for i in ${interfaces[@]} ; do
     353                        sudo -i ifconfig $tap$i down ;
     354                        sudo -i tunctl -d $tap$i ;
     355                done
     356                sudo -i ifconfig $bri down
     357                sudo -i brctl delbr $bri
     358                ;;
     359esac
     360-------------------------------------------------------------------------------
     361
     362Connect your Qemu instance to one of the tap devices, e.g.
     363
     364-------------------------------------------------------------------------------
     365qemu-system-i386 -m 512 -boot a -cpu pentium3 \
     366        -drive file=$HOME/qemu/pc386_fda,index=0,if=floppy,format=raw \
     367        -drive file=fat:$HOME/qemu/hd,format=raw \
     368        -net nic,model=e1000,macaddr=0e:b0:ba:5e:ba:11 \
     369        -net tap,ifname=qtap1,script=no,downscript=no \
     370        -nodefaults -nographic -serial stdio
     371-------------------------------------------------------------------------------
     372
     373Make sure that each Qemu instance uses its own MAC address to avoid an address
     374conflict (or otherwise use it as a test).
    326375
    327376== Issues and TODO
Note: See TracChangeset for help on using the changeset viewer.