added
authorAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 4 Jul 2006 06:51:58 +0000 (06:51 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 4 Jul 2006 06:51:58 +0000 (06:51 -0000)
testing/tests/ikev2/nat-one-rw/description.txt [new file with mode: 0644]
testing/tests/ikev2/nat-one-rw/evaltest.dat [new file with mode: 0644]
testing/tests/ikev2/nat-one-rw/hosts/alice/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev2/nat-one-rw/hosts/sun/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev2/nat-one-rw/posttest.dat [new file with mode: 0644]
testing/tests/ikev2/nat-one-rw/pretest.dat [new file with mode: 0644]
testing/tests/ikev2/nat-one-rw/test.conf [new file with mode: 0644]

diff --git a/testing/tests/ikev2/nat-one-rw/description.txt b/testing/tests/ikev2/nat-one-rw/description.txt
new file mode 100644 (file)
index 0000000..c3b9bb8
--- /dev/null
@@ -0,0 +1,5 @@
+The roadwarrior <b>alice</b> sitting behind the NAT router <b>moon</b> sets up a tunnel to
+gateway <b>sun</b>. UDP encapsulation is used to traverse the NAT router.
+<b>leftfirewall=yes</b> automatically inserts iptables-based firewall rules that let pass
+the tunneled traffic. In order to test the tunnel, the NAT-ed host <b>alice</b> pings the
+client <b>bob</b> behind the gateway <b>sun</b>.
diff --git a/testing/tests/ikev2/nat-one-rw/evaltest.dat b/testing/tests/ikev2/nat-one-rw/evaltest.dat
new file mode 100644 (file)
index 0000000..9a12f36
--- /dev/null
@@ -0,0 +1,5 @@
+alice::ipsec statusall::nat-t.*IKE_SA_ESTABLISHED::YES
+sun::ipsec statusall::nat-t.*IKE_SA_ESTABLISHED::YES
+alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_seq=1::YES
+moon::tcpdump::IP moon.strongswan.org.* > sun.strongswan.org.ipsec-nat-t: UDP::YES
+moon::tcpdump::IP sun.strongswan.org.ipsec-nat-t > moon.strongswan.org.*: UDP::YES
diff --git a/testing/tests/ikev2/nat-one-rw/hosts/alice/etc/ipsec.conf b/testing/tests/ikev2/nat-one-rw/hosts/alice/etc/ipsec.conf
new file mode 100755 (executable)
index 0000000..12eaa94
--- /dev/null
@@ -0,0 +1,21 @@
+# /etc/ipsec.conf - strongSwan IPsec configuration file
+
+config setup
+       strictcrlpolicy=no
+       plutostart=no
+
+conn %default
+       ikelifetime=60m
+       keylife=20m
+       rekeymargin=3m
+       keyingtries=1
+               
+conn nat-t
+       left=%defaultroute
+       leftcert=aliceCert.pem
+       leftid=alice@strongswan.org
+       right=PH_IP_SUN
+       rightid=@sun.strongswan.org
+       rightsubnet=10.2.0.0/16
+       keyexchange=ikev2
+       auto=add
diff --git a/testing/tests/ikev2/nat-one-rw/hosts/sun/etc/ipsec.conf b/testing/tests/ikev2/nat-one-rw/hosts/sun/etc/ipsec.conf
new file mode 100755 (executable)
index 0000000..8e0a768
--- /dev/null
@@ -0,0 +1,33 @@
+# /etc/ipsec.conf - strongSwan IPsec configuration file
+
+config setup
+       strictcrlpolicy=no
+       plutostart=no
+
+conn %default
+       ikelifetime=60m
+       keylife=20m
+       rekeymargin=3m
+       keyingtries=1
+       keyexchange=ikev2
+       left=PH_IP_SUN
+       leftcert=sunCert.pem
+       leftid=@sun.strongswan.org
+
+conn net-net
+       leftsubnet=10.2.0.0/16
+       right=PH_IP_MOON
+       rightsubnet=10.1.0.0/16
+       rightid=@moon.strongswan.org
+       auto=add
+
+conn host-host
+       right=PH_IP_MOON
+       rightid=@moon.strongswan.org
+       auto=add
+
+conn nat-t
+       leftsubnet=10.2.0.0/16
+       right=%any
+       rightsubnetwithin=10.1.0.0/16
+       auto=add
diff --git a/testing/tests/ikev2/nat-one-rw/posttest.dat b/testing/tests/ikev2/nat-one-rw/posttest.dat
new file mode 100644 (file)
index 0000000..c66050e
--- /dev/null
@@ -0,0 +1,4 @@
+alice::ipsec stop
+sun::ipsec stop
+moon::iptables -t nat -F
+
diff --git a/testing/tests/ikev2/nat-one-rw/pretest.dat b/testing/tests/ikev2/nat-one-rw/pretest.dat
new file mode 100644 (file)
index 0000000..d773e76
--- /dev/null
@@ -0,0 +1,10 @@
+sun::echo 1 > /proc/sys/net/ipv4/ip_forward
+moon::echo 1 > /proc/sys/net/ipv4/ip_forward
+moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p udp -j SNAT --to-source PH_IP_MOON:1024-1100
+moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p tcp -j SNAT --to-source PH_IP_MOON:2000-2100
+alice::ipsec start
+sun::ipsec start
+alice::sleep 4
+alice::ipsec up nat-t
+alice::sleep 1 
+
diff --git a/testing/tests/ikev2/nat-one-rw/test.conf b/testing/tests/ikev2/nat-one-rw/test.conf
new file mode 100644 (file)
index 0000000..d84149a
--- /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="moon"
+
+# UML instances on which IPsec is started
+# Used for IPsec logging purposes
+#
+IPSECHOSTS="alice sun"