added passthrough scenario
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 27 Jun 2007 14:25:15 +0000 (14:25 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 27 Jun 2007 14:25:15 +0000 (14:25 -0000)
testing/tests/ikev1/passthrough/description.txt [new file with mode: 0644]
testing/tests/ikev1/passthrough/evaltest.dat [new file with mode: 0644]
testing/tests/ikev1/passthrough/hosts/moon/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev1/passthrough/hosts/sun/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev1/passthrough/posttest.dat [new file with mode: 0644]
testing/tests/ikev1/passthrough/pretest.dat [new file with mode: 0644]
testing/tests/ikev1/passthrough/test.conf [new file with mode: 0644]

diff --git a/testing/tests/ikev1/passthrough/description.txt b/testing/tests/ikev1/passthrough/description.txt
new file mode 100644 (file)
index 0000000..145c5b7
--- /dev/null
@@ -0,0 +1,6 @@
+All IP traffic from the subnet behind the gateway <b>moon</b> is tunneled
+to the gateway  <b>sun</b> using the 0.0.0.0/0 network mask. In order
+to prevent local subnet traffic from escaping through the tunnel, a
+passthrough policy for the 10.1.0.0/16 network is inserted on <b>moon</b>.
+A series of internal and external pings verifies the correct
+functioning of the setup.
diff --git a/testing/tests/ikev1/passthrough/evaltest.dat b/testing/tests/ikev1/passthrough/evaltest.dat
new file mode 100644 (file)
index 0000000..942222f
--- /dev/null
@@ -0,0 +1,9 @@
+moon::ipsec status::net-net.*STATE_QUICK_I2.*IPsec SA established::YES
+sun::ipsec status::net-net.*STATE_QUICK_R2.*IPsec SA established::YES
+alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_seq=1::YES
+alice::ping -c 1 PH_IP_MOON1::64 bytes from PH_IP_MOON1: icmp_seq=1::YES
+alice::ping -c 1 PH_IP_MOON::64 bytes from PH_IP_MOON: icmp_seq=1::YES
+moon::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_seq=1::YES
+moon::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
+sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES
+sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES
diff --git a/testing/tests/ikev1/passthrough/hosts/moon/etc/ipsec.conf b/testing/tests/ikev1/passthrough/hosts/moon/etc/ipsec.conf
new file mode 100755 (executable)
index 0000000..557fb62
--- /dev/null
@@ -0,0 +1,32 @@
+# /etc/ipsec.conf - strongSwan IPsec configuration file
+
+config setup
+       plutodebug=control
+       crlcheckinterval=180
+       strictcrlpolicy=no
+       charonstart=no
+
+conn %default
+       ikelifetime=60m
+       keylife=20m
+       rekeymargin=3m
+       keyingtries=1
+       left=PH_IP_MOON
+       leftsubnet=10.1.0.0/16
+       right=PH_IP_SUN
+
+conn net-net
+       rightsubnet=0.0.0.0/0
+       rightid=@sun.strongswan.org
+       leftid=@moon.strongswan.org
+       leftcert=moonCert.pem
+       leftsourceip=10.1.0.1
+       leftfirewall=yes
+       lefthostaccess=yes
+       auto=add
+        
+conn pass
+       rightsubnet=10.1.0.0/16
+       type=passthrough
+       authby=never
+       auto=route
diff --git a/testing/tests/ikev1/passthrough/hosts/sun/etc/ipsec.conf b/testing/tests/ikev1/passthrough/hosts/sun/etc/ipsec.conf
new file mode 100755 (executable)
index 0000000..9276f1f
--- /dev/null
@@ -0,0 +1,25 @@
+# /etc/ipsec.conf - strongSwan IPsec configuration file
+
+config setup
+       plutodebug=control
+       crlcheckinterval=180
+       strictcrlpolicy=no
+       nat_traversal=yes
+       charonstart=no
+
+conn %default
+       ikelifetime=60m
+       keylife=20m
+       rekeymargin=3m
+       keyingtries=1
+
+conn net-net
+       left=PH_IP_SUN
+       leftcert=sunCert.pem
+       leftid=@sun.strongswan.org
+       leftfirewall=yes
+       leftsubnet=0.0.0.0/0
+       right=PH_IP_MOON
+       rightsubnet=10.1.0.0/16
+       rightid=@moon.strongswan.org
+       auto=add
diff --git a/testing/tests/ikev1/passthrough/posttest.dat b/testing/tests/ikev1/passthrough/posttest.dat
new file mode 100644 (file)
index 0000000..5a9150b
--- /dev/null
@@ -0,0 +1,4 @@
+moon::ipsec stop
+sun::ipsec stop
+moon::/etc/init.d/iptables stop 2> /dev/null
+sun::/etc/init.d/iptables stop 2> /dev/null
diff --git a/testing/tests/ikev1/passthrough/pretest.dat b/testing/tests/ikev1/passthrough/pretest.dat
new file mode 100644 (file)
index 0000000..2606db1
--- /dev/null
@@ -0,0 +1,8 @@
+moon::/etc/init.d/iptables start 2> /dev/null
+sun::/etc/init.d/iptables start 2> /dev/null
+moon::iptables -I INPUT  -i eth1 -s 10.1.0.0/16 -j ACCEPT
+moon::iptables -I OUTPUT -o eth1 -d 10.1.0.0/16 -j ACCEPT
+moon::ipsec start
+sun::ipsec start
+moon::sleep 2
+moon::ipsec up net-net
diff --git a/testing/tests/ikev1/passthrough/test.conf b/testing/tests/ikev1/passthrough/test.conf
new file mode 100644 (file)
index 0000000..d9a6159
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# This configuration file provides information on the
+# UML instances used for this test
+
+# All UML instances that are required for this test
+#
+UMLHOSTS="alice moon winnetou sun bob"
+
+# Corresponding block diagram
+#
+DIAGRAM="a-m-w-s-b.png"
+# UML instances on which tcpdump is to be started
+#
+TCPDUMPHOSTS="sun"
+
+# UML instances on which IPsec is started
+# Used for IPsec logging purposes
+#
+IPSECHOSTS="moon sun"