From 5a1979deb9b961322df6745d33f49ae2321aaf5f Mon Sep 17 00:00:00 2001 From: Andreas Steffen Date: Tue, 6 Nov 2007 13:44:57 +0000 Subject: [PATCH] new net2net ipv6 scenarios for IKEv1 and IKEv2 --- testing/INSTALL | 2 +- .../tests/ipv6/net2net-ikev1/description.txt | 4 +++ testing/tests/ipv6/net2net-ikev1/evaltest.dat | 5 ++++ .../net2net-ikev1/hosts/moon/etc/ipsec.conf | 30 +++++++++++++++++++ .../net2net-ikev1/hosts/sun/etc/ipsec.conf | 29 ++++++++++++++++++ testing/tests/ipv6/net2net-ikev1/posttest.dat | 6 ++++ testing/tests/ipv6/net2net-ikev1/pretest.dat | 10 +++++++ testing/tests/ipv6/net2net-ikev1/test.conf | 21 +++++++++++++ .../tests/ipv6/net2net-ikev2/description.txt | 4 +++ testing/tests/ipv6/net2net-ikev2/evaltest.dat | 5 ++++ .../net2net-ikev2/hosts/moon/etc/ipsec.conf | 27 +++++++++++++++++ .../net2net-ikev2/hosts/sun/etc/ipsec.conf | 26 ++++++++++++++++ testing/tests/ipv6/net2net-ikev2/posttest.dat | 6 ++++ testing/tests/ipv6/net2net-ikev2/pretest.dat | 10 +++++++ testing/tests/ipv6/net2net-ikev2/test.conf | 21 +++++++++++++ 15 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 testing/tests/ipv6/net2net-ikev1/description.txt create mode 100644 testing/tests/ipv6/net2net-ikev1/evaltest.dat create mode 100755 testing/tests/ipv6/net2net-ikev1/hosts/moon/etc/ipsec.conf create mode 100755 testing/tests/ipv6/net2net-ikev1/hosts/sun/etc/ipsec.conf create mode 100644 testing/tests/ipv6/net2net-ikev1/posttest.dat create mode 100644 testing/tests/ipv6/net2net-ikev1/pretest.dat create mode 100644 testing/tests/ipv6/net2net-ikev1/test.conf create mode 100644 testing/tests/ipv6/net2net-ikev2/description.txt create mode 100644 testing/tests/ipv6/net2net-ikev2/evaltest.dat create mode 100755 testing/tests/ipv6/net2net-ikev2/hosts/moon/etc/ipsec.conf create mode 100755 testing/tests/ipv6/net2net-ikev2/hosts/sun/etc/ipsec.conf create mode 100644 testing/tests/ipv6/net2net-ikev2/posttest.dat create mode 100644 testing/tests/ipv6/net2net-ikev2/pretest.dat create mode 100644 testing/tests/ipv6/net2net-ikev2/test.conf diff --git a/testing/INSTALL b/testing/INSTALL index d5571bb43..fcb4d2623 100644 --- a/testing/INSTALL +++ b/testing/INSTALL @@ -71,7 +71,7 @@ are required for the strongSwan testing environment: * The latest strongSwan distribution - http://download.strongswan.org/strongswan-4.1.8.tar.gz + http://download.strongswan.org/strongswan-4.1.9.tar.gz 3. Creating the environment diff --git a/testing/tests/ipv6/net2net-ikev1/description.txt b/testing/tests/ipv6/net2net-ikev1/description.txt new file mode 100644 index 000000000..4c1b5c8d8 --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev1/description.txt @@ -0,0 +1,4 @@ +An IPv6 ESP tunnel connection between the gateways moon and sun is successfully set up. +It connects the two subnets hiding behind their respective gateways. The authentication is based on +X.509 certificates. In order to test the net-to-net tunnel client alice behind moon +sends an IPv6 ICMP request to client bob behind sun using the ping6 command. diff --git a/testing/tests/ipv6/net2net-ikev1/evaltest.dat b/testing/tests/ipv6/net2net-ikev1/evaltest.dat new file mode 100644 index 000000000..459b0a630 --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev1/evaltest.dat @@ -0,0 +1,5 @@ +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::ping6 -c 1 -p deadbeef ip6-bob.strongswan.org::64 bytes from ip6-bob.strongswan.org: icmp_seq=1::YES +sun::tcpdump::IP6 ip6-moon.strongswan.org > ip6-sun.strongswan.org: ESP::YES +sun::tcpdump::IP6 ip6-sun.strongswan.org > ip6-moon.strongswan.org: ESP::YES diff --git a/testing/tests/ipv6/net2net-ikev1/hosts/moon/etc/ipsec.conf b/testing/tests/ipv6/net2net-ikev1/hosts/moon/etc/ipsec.conf new file mode 100755 index 000000000..9499140c5 --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev1/hosts/moon/etc/ipsec.conf @@ -0,0 +1,30 @@ +# /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 net-net + also=host-host + leftsubnet=fec1::0/16 + rightsubnet=fec2::0/16 + +conn host-host + left=PH_IP6_MOON + leftnexthop=0::0 + leftcert=moonCert.pem + leftid=@moon.strongswan.org + leftfirewall=yes + right=PH_IP6_SUN + rightnexthop=0::0 + rightid=@sun.strongswan.org + auto=add + diff --git a/testing/tests/ipv6/net2net-ikev1/hosts/sun/etc/ipsec.conf b/testing/tests/ipv6/net2net-ikev1/hosts/sun/etc/ipsec.conf new file mode 100755 index 000000000..c64904a6e --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev1/hosts/sun/etc/ipsec.conf @@ -0,0 +1,29 @@ +# /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 net-net + also=host-host + leftsubnet=fec2::0/16 + rightsubnet=fec1::0/16 + +conn host-host + left=PH_IP6_SUN + leftnexthop=0::0 + leftcert=sunCert.pem + leftid=@sun.strongswan.org + leftfirewall=yes + right=PH_IP6_MOON + rightnexthop=0::0 + rightid=@moon.strongswan.org + auto=add diff --git a/testing/tests/ipv6/net2net-ikev1/posttest.dat b/testing/tests/ipv6/net2net-ikev1/posttest.dat new file mode 100644 index 000000000..f527995ec --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev1/posttest.dat @@ -0,0 +1,6 @@ +moon::ipsec stop +sun::ipsec stop +alice::"ip route del fec2:\:/16 via fec1:\:1" +moon::"ip route del fec2:\:/16 via fec0:\:2" +sun::"ip route del fec1:\:/16 via fec0:\:1" +bob::"ip route del fec1:\:/16 via fec2:\:1" diff --git a/testing/tests/ipv6/net2net-ikev1/pretest.dat b/testing/tests/ipv6/net2net-ikev1/pretest.dat new file mode 100644 index 000000000..347a27bed --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev1/pretest.dat @@ -0,0 +1,10 @@ +moon::echo "1" >/proc/sys/net/ipv6/conf/all/forwarding +sun::echo "1" >/proc/sys/net/ipv6/conf/all/forwarding +alice::"ip route add fec2:\:/16 via fec1:\:1" +moon::"ip route add fec2:\:/16 via fec0:\:2" +sun::"ip route add fec1:\:/16 via fec0:\:1" +bob::"ip route add fec1:\:/16 via fec2:\:1" +moon::ipsec start +sun::ipsec start +moon::sleep 2 +moon::ipsec up net-net diff --git a/testing/tests/ipv6/net2net-ikev1/test.conf b/testing/tests/ipv6/net2net-ikev1/test.conf new file mode 100644 index 000000000..9ebb969be --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev1/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 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" diff --git a/testing/tests/ipv6/net2net-ikev2/description.txt b/testing/tests/ipv6/net2net-ikev2/description.txt new file mode 100644 index 000000000..4c1b5c8d8 --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev2/description.txt @@ -0,0 +1,4 @@ +An IPv6 ESP tunnel connection between the gateways moon and sun is successfully set up. +It connects the two subnets hiding behind their respective gateways. The authentication is based on +X.509 certificates. In order to test the net-to-net tunnel client alice behind moon +sends an IPv6 ICMP request to client bob behind sun using the ping6 command. diff --git a/testing/tests/ipv6/net2net-ikev2/evaltest.dat b/testing/tests/ipv6/net2net-ikev2/evaltest.dat new file mode 100644 index 000000000..1b4e7c88a --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev2/evaltest.dat @@ -0,0 +1,5 @@ +moon::ipsec status::net-net.*INSTALLED::YES +sun::ipsec status::net.net.*INSTALLED::YES +alice::ping6 -c 1 -p deadbeef ip6-bob.strongswan.org::64 bytes from ip6-bob.strongswan.org: icmp_seq=1::YES +sun::tcpdump::IP6 ip6-moon.strongswan.org > ip6-sun.strongswan.org: ESP::YES +sun::tcpdump::IP6 ip6-sun.strongswan.org > ip6-moon.strongswan.org: ESP::YES diff --git a/testing/tests/ipv6/net2net-ikev2/hosts/moon/etc/ipsec.conf b/testing/tests/ipv6/net2net-ikev2/hosts/moon/etc/ipsec.conf new file mode 100755 index 000000000..da750b1de --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev2/hosts/moon/etc/ipsec.conf @@ -0,0 +1,27 @@ +# /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 + +conn net-net + also=host-host + leftsubnet=fec1::0/16 + rightsubnet=fec2::0/16 + +conn host-host + left=PH_IP6_MOON + leftcert=moonCert.pem + leftid=@moon.strongswan.org + leftfirewall=yes + right=PH_IP6_SUN + rightid=@sun.strongswan.org + auto=add + diff --git a/testing/tests/ipv6/net2net-ikev2/hosts/sun/etc/ipsec.conf b/testing/tests/ipv6/net2net-ikev2/hosts/sun/etc/ipsec.conf new file mode 100755 index 000000000..bad82a8cb --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev2/hosts/sun/etc/ipsec.conf @@ -0,0 +1,26 @@ +# /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 + +conn net-net + also=host-host + leftsubnet=fec2::0/16 + rightsubnet=fec1::0/16 + +conn host-host + left=PH_IP6_SUN + leftcert=sunCert.pem + leftid=@sun.strongswan.org + leftfirewall=yes + right=PH_IP6_MOON + rightid=@moon.strongswan.org + auto=add diff --git a/testing/tests/ipv6/net2net-ikev2/posttest.dat b/testing/tests/ipv6/net2net-ikev2/posttest.dat new file mode 100644 index 000000000..f527995ec --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev2/posttest.dat @@ -0,0 +1,6 @@ +moon::ipsec stop +sun::ipsec stop +alice::"ip route del fec2:\:/16 via fec1:\:1" +moon::"ip route del fec2:\:/16 via fec0:\:2" +sun::"ip route del fec1:\:/16 via fec0:\:1" +bob::"ip route del fec1:\:/16 via fec2:\:1" diff --git a/testing/tests/ipv6/net2net-ikev2/pretest.dat b/testing/tests/ipv6/net2net-ikev2/pretest.dat new file mode 100644 index 000000000..347a27bed --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev2/pretest.dat @@ -0,0 +1,10 @@ +moon::echo "1" >/proc/sys/net/ipv6/conf/all/forwarding +sun::echo "1" >/proc/sys/net/ipv6/conf/all/forwarding +alice::"ip route add fec2:\:/16 via fec1:\:1" +moon::"ip route add fec2:\:/16 via fec0:\:2" +sun::"ip route add fec1:\:/16 via fec0:\:1" +bob::"ip route add fec1:\:/16 via fec2:\:1" +moon::ipsec start +sun::ipsec start +moon::sleep 2 +moon::ipsec up net-net diff --git a/testing/tests/ipv6/net2net-ikev2/test.conf b/testing/tests/ipv6/net2net-ikev2/test.conf new file mode 100644 index 000000000..9ebb969be --- /dev/null +++ b/testing/tests/ipv6/net2net-ikev2/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 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"