summaryrefslogtreecommitdiff
path: root/testing/scripts/start-bridges
blob: 1e09d6e7d79d1a23e19906a61940218c919ed639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# start the UML bridges in the kernel using the brctl command
#
# Copyright (C) 2009  Andreas Steffen
# HSR Hochschule fuer Technik Rapperswil
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.

DIR=`dirname $0`

source $DIR/function.sh

# create umlbr1 and its taps 
#
if [ `brctl show | grep umlbr1 | wc -l` -eq 1 ]
then
	cecho " * Great, umlbr1 is already running!"
else
	cecho-n " * Starting umlbr1 with taps.."
	umlbr_add     1 10.1.0.254 255.255.0.0
	umlbr_add_tap 1 alice
	umlbr_add_tap 1 venus
	umlbr_add_tap 1 moon
	cgecho "done"
fi

# create umlbr0 and its taps
#
if [ `brctl show | grep umlbr0 | wc -l` -eq 1 ]
then
	cecho " * Great, umlbr0 is already running!"
else
	cecho-n " * Starting umlbr0 with taps.."
	umlbr_add     0 192.168.0.254 255.255.255.0
	umlbr_add_tap 0 alice
	umlbr_add_tap 0 moon
	umlbr_add_tap 0 carol
	umlbr_add_tap 0 winnetou
	umlbr_add_tap 0 dave
	umlbr_add_tap 0 sun
	cgecho "done"
fi

# create umlbr2 and its taps
#
if [ `brctl show | grep umlbr2 | wc -l` -eq 1 ]
then
	cecho " * Great, umlbr2 is already running!"
else
	cecho-n " * Starting umlbr2 with taps.."
	umlbr_add     2 10.2.0.254 255.255.0.0
	umlbr_add_tap 2 sun
	umlbr_add_tap 2 bob
	cgecho "done"
fi