aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2008-07-22 17:21:01 +0000
committerAndreas Steffen <andreas.steffen@strongswan.org>2008-07-22 17:21:01 +0000
commit295826b9f02b2d5d320cf2b9a6fb41898faa2067 (patch)
treed0f0c13d4ec2298d056609a60390ac7d62cc4c9c /src
parent51c8f8261fd819011365168fd673b6955fefd61b (diff)
downloadstrongswan-295826b9f02b2d5d320cf2b9a6fb41898faa2067.tar.bz2
strongswan-295826b9f02b2d5d320cf2b9a6fb41898faa2067.tar.xz
start default strongSwan UML topology
Diffstat (limited to 'src')
-rw-r--r--src/dumm/scripts/start_testing.rb56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/dumm/scripts/start_testing.rb b/src/dumm/scripts/start_testing.rb
new file mode 100644
index 000000000..c92e805d6
--- /dev/null
+++ b/src/dumm/scripts/start_testing.rb
@@ -0,0 +1,56 @@
+br0 = Bridge.new("br0")
+br1 = Bridge.new("br1")
+br2 = Bridge.new("br2")
+
+alice = Guest["alice"]
+venus = Guest["venus"]
+moon = Guest["moon"]
+carol = Guest["carol"]
+winnetou = Guest["winnetou"]
+dave = Guest["dave"]
+sun = Guest["sun"]
+bob = Guest["bob"]
+
+alice.start
+venus.start
+moon.start
+carol.start
+winnetou.start
+dave.start
+sun.start
+bob.start
+
+alice.add("eth0").connect(br1).add("10.1.0.10")
+venus.add("eth0").connect(br1).add("10.1.0.20")
+moon.add("eth1").connect(br1).add("10.1.0.1")
+moon.add("eth0").connect(br0).add("192.168.0.1")
+carol.add("eth0").connect(br0).add("192.168.0.100")
+winnetou.add("eth0").connect(br0).add("192.168.0.150")
+dave.add("eth0").connect(br0).add("192.168.0.200")
+sun.add("eth0").connect(br0).add("192.168.0.2")
+sun.add("eth1").connect(br2).add("10.2.0.1")
+bob.add("eth0").connect(br2).add("10.2.0.10")
+
+alice.exec("ip route add dev eth0 10.1.0.0/16 src 10.1.0.10")
+venus.exec("ip route add dev eth0 10.1.0.0/16 src 10.1.0.20")
+moon.exec("ip route add dev eth1 10.1.0.0/16 src 10.1.0.1")
+moon.exec("ip route add dev eth0 192.168.0.0/24 src 192.168.0.1")
+carol.exec("ip route add dev eth0 192.168.0.0/24 src 192.168.0.100")
+winnetou.exec("ip route add dev eth0 192.168.0.0/24 src 192.168.0.150")
+dave.exec("ip route add dev eth0 192.168.0.0/24 src 192.168.0.200")
+sun.exec("ip route add dev eth0 192.168.0.0/24 src 192.168.0.2")
+sun.exec("ip route add dev eth1 10.2.0.0/16 src 10.2.0.1")
+bob.exec("ip route add dev eth0 10.2.0.0/16 src 10.2.0.10")
+
+alice.exec("ip route add default via 10.1.0.1")
+venus.exec("ip route add default via 10.1.0.1")
+moon.exec("ip route add default via 192.168.0.254")
+carol.exec("ip route add default via 192.168.0.254")
+winnetou.exec("ip route add default via 192.168.0.254")
+dave.exec("ip route add default via 192.168.0.254")
+sun.exec("ip route add default via 192.168.0.254")
+bob.exec("ip route add default via 10.2.0.1")
+
+moon.exec("echo 1 > /proc/sys/net/ipv4/ip_forward")
+sun.exec("echo 1 > /proc/sys/net/ipv4/ip_forward")
+