VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/solaris/tapinit_solaris.sh@ 15793

Last change on this file since 15793 was 5587, checked in by vboxsync, 17 years ago

example scripts.

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Revision Id
File size: 670 bytes
Line 
1#!/bin/bash
2
3# VirtualBox TAP setup script for Solaris hosts.
4# usage: ./tapinit.sh tapname
5#
6# format of TAP interface names MUST be like [name][number]
7# example: tap0, tap1, tap2 etc.
8
9if [ -z "$1" ]; then
10 echo "Missing TAP interface name."
11 echo
12 echo "Usage: $0 tapifname"
13 exit 1
14fi
15
16tap_name=`echo $1 | /usr/xpg4/bin/tr -s [:upper:] [:lower:]`
17ppa=${tap_name##*[a-z]}
18tap_name=$1
19host_ip="192.168.1.10${ppa}"
20guest_ip="192.168.1.20${ppa}"
21netmask="255.255.255.0"
22
23/sbin/ifconfig $tap_name $host_ip destination $guest_ip netmask $netmask
24/sbin/ifconfig $tap_name up
25
26# Output the TAP interface though not used by VirtualBox
27echo "$tap_name"
28
29exit $?
30
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette