]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
created ikev1/mode-config-multiple scenario
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 1 Oct 2009 07:42:35 +0000 (09:42 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 1 Oct 2009 07:42:35 +0000 (09:42 +0200)
testing/tests/ikev1/mode-config-multiple/description.txt [new file with mode: 0644]
testing/tests/ikev1/mode-config-multiple/evaltest.dat [new file with mode: 0644]
testing/tests/ikev1/mode-config-multiple/hosts/carol/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev1/mode-config-multiple/hosts/dave/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/ipsec.conf [new file with mode: 0755]
testing/tests/ikev1/mode-config-multiple/hosts/moon/etc/strongswan.conf [new file with mode: 0644]
testing/tests/ikev1/mode-config-multiple/posttest.dat [new file with mode: 0644]
testing/tests/ikev1/mode-config-multiple/pretest.dat [new file with mode: 0644]
testing/tests/ikev1/mode-config-multiple/test.conf [new file with mode: 0644]

diff --git a/testing/tests/ikev1/mode-config-multiple/description.txt b/testing/tests/ikev1/mode-config-multiple/description.txt
new file mode 100644 (file)
index 0000000..6be00e7
--- /dev/null
@@ -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 (file)
index 0000000..7353453
--- /dev/null
@@ -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 (executable)
index 0000000..f059166
--- /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
+
+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 (executable)
index 0000000..44644f2
--- /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
+
+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 (executable)
index 0000000..2f772cf
--- /dev/null
@@ -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 (file)
index 0000000..83cdb0d
--- /dev/null
@@ -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 (file)
index 0000000..42fa835
--- /dev/null
@@ -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 (file)
index 0000000..63f52e2
--- /dev/null
@@ -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 (file)
index 0000000..d8fa516
--- /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 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"