summaryrefslogtreecommitdiff
path: root/testing/tests/ikev1/mode-config-multiple
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2010-02-23 10:34:14 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2010-02-23 10:34:14 +0000
commited7d79f96177044949744da10f4431c1d6242241 (patch)
tree3aabaa55ed3b5291daef891cfee9befb5235e2b8 /testing/tests/ikev1/mode-config-multiple
parent7410d3c6d6a9a1cd7aa55083c938946af6ff9498 (diff)
downloadvyos-strongswan-ed7d79f96177044949744da10f4431c1d6242241.tar.gz
vyos-strongswan-ed7d79f96177044949744da10f4431c1d6242241.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.3.6)
Diffstat (limited to 'testing/tests/ikev1/mode-config-multiple')
-rw-r--r--testing/tests/ikev1/mode-config-multiple/description.txt6
-rw-r--r--testing/tests/ikev1/mode-config-multiple/evaltest.dat29
-rwxr-xr-xtesting/tests/ikev1/mode-config-multiple/hosts/carol/etc/ipsec.conf32
-rwxr-xr-xtesting/tests/ikev1/mode-config-multiple/hosts/dave/etc/ipsec.conf32
-rwxr-xr-xtesting/tests/ikev1/mode-config-multiple/hosts/moon/etc/ipsec.conf49
-rw-r--r--testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/strongswan.conf13
-rw-r--r--testing/tests/ikev1/mode-config-multiple/posttest.dat8
-rw-r--r--testing/tests/ikev1/mode-config-multiple/pretest.dat12
-rw-r--r--testing/tests/ikev1/mode-config-multiple/test.conf21
9 files changed, 202 insertions, 0 deletions
diff --git a/testing/tests/ikev1/mode-config-multiple/description.txt b/testing/tests/ikev1/mode-config-multiple/description.txt
new file mode 100644
index 000000000..6be00e744
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/description.txt
@@ -0,0 +1,6 @@
+The roadwarriors <b>carol</b> and <b>dave</b> set up a connection each to gateway <b>moon</b>.
+Both <b>carol</b> and <b>dave</b> request a <b>virtual IP</b> via the IKE Mode Config protocol
+by using the <b>leftsourceip=%modeconfig</b> parameter. After setting up an IPsec SA to reach
+the hosts <b>alice</b> and <b>venus</b>, respectively, both roadwarriors set up a second
+IPsec SA to <b>venus</b> and <b>alice</b>, respectively, inheriting the virtual IP address
+from the previous Mode Config negotiation.
diff --git a/testing/tests/ikev1/mode-config-multiple/evaltest.dat b/testing/tests/ikev1/mode-config-multiple/evaltest.dat
new file mode 100644
index 000000000..735345315
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/evaltest.dat
@@ -0,0 +1,29 @@
+carol::cat /var/log/auth.log::alice.*setting virtual IP source address to PH_IP_CAROL1::YES
+carol::ipsec status::alice.*STATE_QUICK_I2.*IPsec SA established::YES
+carol::cat /var/log/auth.log::venus.*inheriting virtual IP source address PH_IP_CAROL1 from ModeCfg::YES
+carol::ipsec status::venus.*STATE_QUICK_I2.*IPsec SA established::YES
+carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
+carol::ping -c 1 PH_IP_VENUS::64 bytes from PH_IP_VENUS: icmp_seq=1::YES
+dave::cat /var/log/auth.log::venus.*setting virtual IP source address to PH_IP_DAVE1::YES
+dave::ipsec status::venus.*STATE_QUICK_I2.*IPsec SA established::YES
+dave::cat /var/log/auth.log::alice.*inheriting virtual IP source address PH_IP_DAVE1 from ModeCfg::YES
+dave::ipsec status::alice.*STATE_QUICK_I2.*IPsec SA established::YES
+dave::ping -c 1 PH_IP_VENUS::64 bytes from PH_IP_VENUS: icmp_seq=1::YES
+dave::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
+moon::ipsec status::carol-alice.*STATE_QUICK_R2.*IPsec SA established::YES
+moon::ipsec status::carol-venus.*STATE_QUICK_R2.*IPsec SA established::YES
+moon::ipsec status::dave-venus.*STATE_QUICK_R2.*IPsec SA established::YES
+moon::ipsec status::dave-alice.*STATE_QUICK_R2.*IPsec SA established::YES
+moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
+moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
+moon::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
+moon::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
+alice::tcpdump::IP carol1.strongswan.org > alice.strongswan.org: ICMP echo request::YES
+alice::tcpdump::IP alice.strongswan.org > carol1.strongswan.org: ICMP echo reply::YES
+alice::tcpdump::IP dave1.strongswan.org > alice.strongswan.org: ICMP echo request::YES
+alice::tcpdump::IP alice.strongswan.org > dave1.strongswan.org: ICMP echo reply::YES
+venus::tcpdump::IP carol1.strongswan.org > venus.strongswan.org: ICMP echo request::YES
+venus::tcpdump::IP venus.strongswan.org > carol1.strongswan.org: ICMP echo reply::YES
+venus::tcpdump::IP dave1.strongswan.org > venus.strongswan.org: ICMP echo request::YES
+venus::tcpdump::IP venus.strongswan.org > dave1.strongswan.org: ICMP echo reply::YES
+
diff --git a/testing/tests/ikev1/mode-config-multiple/hosts/carol/etc/ipsec.conf b/testing/tests/ikev1/mode-config-multiple/hosts/carol/etc/ipsec.conf
new file mode 100755
index 000000000..f05916614
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/hosts/carol/etc/ipsec.conf
@@ -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
+
+conn alice
+ also=home
+ rightsubnet=10.1.0.10/32
+ auto=add
+
+conn venus
+ also=home
+ rightsubnet=10.1.0.20/32
+ auto=add
+
+conn home
+ left=192.168.0.100
+ leftsourceip=%modeconfig
+ leftcert=carolCert.pem
+ leftid=carol@strongswan.org
+ leftfirewall=yes
+ right=192.168.0.1
+ rightid=@moon.strongswan.org
diff --git a/testing/tests/ikev1/mode-config-multiple/hosts/dave/etc/ipsec.conf b/testing/tests/ikev1/mode-config-multiple/hosts/dave/etc/ipsec.conf
new file mode 100755
index 000000000..44644f2af
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/hosts/dave/etc/ipsec.conf
@@ -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
+
+conn alice
+ also=home
+ rightsubnet=10.1.0.10/32
+ auto=add
+
+conn venus
+ also=home
+ rightsubnet=10.1.0.20/32
+ auto=add
+
+conn home
+ left=PH_IP_DAVE
+ leftsourceip=%modeconfig
+ leftcert=daveCert.pem
+ leftid=dave@strongswan.org
+ leftfirewall=yes
+ right=PH_IP_MOON
+ rightid=@moon.strongswan.org
diff --git a/testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/ipsec.conf b/testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/ipsec.conf
new file mode 100755
index 000000000..2f772cfdd
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/ipsec.conf
@@ -0,0 +1,49 @@
+# /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=192.168.0.1
+ leftsourceip=10.1.0.1
+ leftcert=moonCert.pem
+ leftid=@moon.strongswan.org
+ leftfirewall=yes
+
+conn carol-alice
+ also=carol
+ leftsubnet=10.1.0.10/32
+ auto=add
+
+conn carol-venus
+ also=carol
+ leftsubnet=10.1.0.20/32
+ auto=add
+
+conn carol
+ right=%any
+ rightid=carol@strongswan.org
+ rightsourceip=10.3.0.1
+
+conn dave-alice
+ also=dave
+ leftsubnet=10.1.0.10/32
+ auto=add
+
+conn dave-venus
+ also=dave
+ leftsubnet=10.1.0.20/32
+ auto=add
+
+conn dave
+ right=%any
+ rightid=dave@strongswan.org
+ rightsourceip=10.3.0.2
+
diff --git a/testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/strongswan.conf b/testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/strongswan.conf
new file mode 100644
index 000000000..83cdb0d28
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/strongswan.conf
@@ -0,0 +1,13 @@
+# /etc/strongswan.conf - strongSwan configuration file
+
+pluto {
+ load = sha1 sha2 md5 aes des hmac pem pkcs1 x509 gmp random curl
+ dns1 = PH_IP_WINNETOU
+ dns2 = PH_IP6_VENUS
+}
+
+# pluto uses optimized DH exponent sizes (RFC 3526)
+
+libstrongswan {
+ dh_exponent_ansi_x9_42 = no
+}
diff --git a/testing/tests/ikev1/mode-config-multiple/posttest.dat b/testing/tests/ikev1/mode-config-multiple/posttest.dat
new file mode 100644
index 000000000..42fa8359b
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/posttest.dat
@@ -0,0 +1,8 @@
+moon::ipsec stop
+carol::ipsec stop
+dave::ipsec stop
+moon::/etc/init.d/iptables stop 2> /dev/null
+carol::/etc/init.d/iptables stop 2> /dev/null
+dave::/etc/init.d/iptables stop 2> /dev/null
+carol::ip addr del PH_IP_CAROL1/32 dev eth0
+dave::ip addr del PH_IP_DAVE1/32 dev eth0
diff --git a/testing/tests/ikev1/mode-config-multiple/pretest.dat b/testing/tests/ikev1/mode-config-multiple/pretest.dat
new file mode 100644
index 000000000..63f52e274
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/pretest.dat
@@ -0,0 +1,12 @@
+moon::/etc/init.d/iptables start 2> /dev/null
+carol::/etc/init.d/iptables start 2> /dev/null
+dave::/etc/init.d/iptables start 2> /dev/null
+carol::ipsec start
+dave::ipsec start
+moon::ipsec start
+carol::sleep 2
+carol::ipsec up alice
+carol::ipsec up venus
+dave::ipsec up venus
+dave::ipsec up alice
+carol::sleep 1
diff --git a/testing/tests/ikev1/mode-config-multiple/test.conf b/testing/tests/ikev1/mode-config-multiple/test.conf
new file mode 100644
index 000000000..d8fa5162d
--- /dev/null
+++ b/testing/tests/ikev1/mode-config-multiple/test.conf
@@ -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 carol winnetou dave"
+
+# Corresponding block diagram
+#
+DIAGRAM="a-m-c-w-d.png"
+
+# UML instances on which tcpdump is to be started
+#
+TCPDUMPHOSTS="moon alice venus"
+
+# UML instances on which IPsec is started
+# Used for IPsec logging purposes
+#
+IPSECHOSTS="moon carol dave"