Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat /etc/network/interfaces
- auto lo
- iface lo inet loopback
- auto eth0
- iface eth0 inet dhcp
- #auto br0
- iface br0 inet dhcp
- pre-up tunctl -t tap0 -g tuntap
- pre-up tunctl -t tap1 -g tuntap
- pre-up ip link set tap0 up
- pre-up ip link set tap1 up
- bridge_ports eth0 tap0 tap1
- bridge_stp off
- bridge_maxwait 0
- bridge_fd 0
- post-down ip link set tap0 down
- post-down ip link set tap1 down
- post-down tunctl -d tap0
- post-down tunctl -d tap1
- $ cat bin/debqemu.sh
- #!/bin/sh
- quit()
- {
- ret=0
- if [ $# -gt 0 ];
- then
- ret=$1
- shift
- fi
- if [ $# -gt 0 ];
- then
- printf "$1\n"
- shift
- fi
- exit $ret
- }
- image=""
- kernel=""
- if [ "x$1" = "xle" ];
- then
- qemu=qemu-system-mipsel
- image="$HOME/code/debian-qemu/le/debian_squeeze_mipsel_standard.qcow2"
- kernel="$HOME/code/debian-qemu/le/vmlinux-2.6.32-5-4kc-malta"
- iface=tap1
- # reset /etc/udev/rules.d/70-persistent-net.rules in qemu guest if you change mac addrs
- macaddr="52:54:00:12:34:57"
- elif [ "x$1" = "xbe" ];
- then
- qemu=qemu-system-mips
- image="$HOME/code/debian-qemu/be/debian_squeeze_mips_standard.qcow2"
- kernel="$HOME/code/debian-qemu/be/vmlinux-2.6.32-5-4kc-malta"
- iface=tap0
- # reset /etc/udev/rules.d/70-persistent-net.rules in qemu guest if you change mac addrs
- macaddr="52:54:00:12:34:56"
- else
- quit 1 "Specify le or be endianness."
- fi
- if [ ! -d ~/code/debian-qemu ];
- then
- sudo mount /srv/endor/code || quit 1 "Failed to mount /srv/endor/code";
- fi
- echo "Stopping eth0, starting br0."
- bridge.sh || quit 1 "Failed to start br0."
- echo "Starting Debian system QEMU session."
- $qemu -net nic,macaddr=$macaddr -net tap,ifname=$iface,script=no,downscript=no -nographic -M malta -kernel $kernel -hda $image -append "root=/dev/sda1 console=tty0"
- $ cat /home/zach/bin/bridge.sh
- #!/bin/sh
- sudo ifdown eth0
- sudo ifup br0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement