#!/bin/ksh # /etc/qemu-if: QEMU's TAP network setup script for Solaris # $1 = tap0, tap1, ... if [ -z "$1" ] then echo "Usage: $0 interface" exit 1 fi DEV=${1%%[0-9]} PPA=${1##*[a-z]} # # You are expected to use network addresses for # the guests some non-used network as it relates # to your host to setup the private network # between the HOST and the QEMU Guest # NETMASK="255.255.255.0" # # OS can be defined by the shell script that # sol_qemu_tap calls to initialize QEMU so you # can have predictable IP addresses for # the QEMU Guest (though you still have to set # them in the Guest) # case "${OS}" in s10) HOST_IP="192.168.1.25${PPA}" GUEST_IP="192.168.1.1${PPA}" ;; winxp) HOST_IP="192.168.2.250" GUEST_IP="192.168.2.10" ;; win2k3) HOST_IP="192.168.3.250" GUEST_IP="192.168.3.10" ;; *) HOST_IP="192.168.1.25${PPA}" GUEST_IP="192.168.1.1${PPA}" ;; esac #set -x /sbin/ifconfig $1 ${HOST_IP} destination ${GUEST_IP} netmask ${NETMASK} up exit $?