tests with subdirectory structure
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
Both the roadwarrior <b>carol</b> and the gateway <b>moon</b> generate a
|
||||
PKCS#1 RSA private key and a PKCS#10 certificate request using the
|
||||
<b>ipsec scepclient</b> function. Because the UML testing environment
|
||||
does not offer enough entropy, the non-blocking /dev/urandom device is
|
||||
used in place of /dev/random for generating the random primes.
|
||||
<p>
|
||||
The certificate requests are copied to <b>winnetou</b> where a certification
|
||||
authority based on OpenSSL issues X.509 certificates by verifying and
|
||||
signing the PCKS#10 requests. The certificates are then copied back to
|
||||
the corresponding hosts and used to set up a road warrior connection
|
||||
initiated by <b>carol</b>
|
||||
@@ -0,0 +1,5 @@
|
||||
carol::ipsec status::home.*STATE_QUICK_I2.*IPsec SA established::YES
|
||||
moon::ipsec status::rw.*STATE_QUICK_R2.*IPsec SA established::YES
|
||||
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
|
||||
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
||||
moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
|
||||
@@ -0,0 +1,28 @@
|
||||
# /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 home
|
||||
left=PH_IP_CAROL
|
||||
leftnexthop=%direct
|
||||
leftcert=myCert.pem
|
||||
[email protected]
|
||||
leftfirewall=yes
|
||||
right=PH_IP_MOON
|
||||
rightsubnet=10.1.0.0/16
|
||||
[email protected]
|
||||
auto=add
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||
|
||||
: RSA myKey.der
|
||||
@@ -0,0 +1,3 @@
|
||||
--debug-control
|
||||
--out pkcs1
|
||||
--out pkcs10
|
||||
@@ -0,0 +1,3 @@
|
||||
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||
|
||||
: RSA moonKey.der
|
||||
@@ -0,0 +1,4 @@
|
||||
--debug-control
|
||||
--keylength 2064
|
||||
--out pkcs1=moonKey.der
|
||||
--out pkcs10=moonReq.der
|
||||
@@ -0,0 +1,2 @@
|
||||
y
|
||||
y
|
||||
@@ -0,0 +1,13 @@
|
||||
moon::iptables -v -n -L
|
||||
carol::iptables -v -n -L
|
||||
moon::ipsec stop
|
||||
carol::ipsec stop
|
||||
moon::/etc/init.d/iptables stop 2> /dev/null
|
||||
carol::/etc/init.d/iptables stop 2> /dev/null
|
||||
carol::rm /etc/ipsec.d/private/*
|
||||
carol::rm /etc/ipsec.d/certs/*
|
||||
carol::rm /etc/ipsec.d/reqs/*
|
||||
moon::rm /etc/ipsec.d/private/*
|
||||
moon::rm /etc/ipsec.d/reqs/*
|
||||
winnetou::rm /etc/openssl/carol*
|
||||
winnetou::rm /etc/openssl/moon*
|
||||
@@ -0,0 +1,22 @@
|
||||
moon::/etc/init.d/iptables start 2> /dev/null
|
||||
carol::/etc/init.d/iptables start 2> /dev/null
|
||||
carol::rm /etc/ipsec.d/private/*
|
||||
carol::rm /etc/ipsec.d/certs/*
|
||||
carol::cat /etc/scepclient.conf
|
||||
carol::ipsec scepclient --dn \"C=CH, O=Linux strongSwan, [email protected]\" --optionsfrom /etc/scepclient.conf
|
||||
winnetou::scp carol:/etc/ipsec.d/reqs/myReq.der /etc/openssl/carolReq.der
|
||||
winnetou::openssl req -inform der -in /etc/openssl/carolReq.der -out /etc/openssl/carolReq.pem
|
||||
winnetou::cd /etc/openssl; COMMON_NAME="[email protected]" openssl ca -in carolReq.pem -out carolCert.pem -notext -config openssl.cnf -extensions user_ext < yy.txt
|
||||
winnetou::scp /etc/openssl/carolCert.pem carol:/etc/ipsec.d/certs/myCert.pem
|
||||
moon::rm /etc/ipsec.d/private/*
|
||||
moon::rm /etc/ipsec.d/certs/*
|
||||
moon::cat /etc/scepclient.conf
|
||||
moon::ipsec scepclient --dn \"C=CH, O=Linux strongSwan, SN=01, CN=moon.strongswan.org\" --optionsfrom /etc/scepclient.conf
|
||||
winnetou::scp moon:/etc/ipsec.d/reqs/moonReq.der /etc/openssl/
|
||||
winnetou::openssl req -inform der -in /etc/openssl/moonReq.der -out /etc/openssl/moonReq.pem
|
||||
winnetou::cd /etc/openssl; COMMON_NAME="moon.strongswan.org" openssl ca -in moonReq.pem -out moonCert.pem -notext -config openssl.cnf -extensions host_ext < yy.txt
|
||||
winnetou::scp /etc/openssl/moonCert.pem moon:/etc/ipsec.d/certs/
|
||||
carol::ipsec start
|
||||
moon::ipsec start
|
||||
carol::sleep 2
|
||||
carol::ipsec up home
|
||||
@@ -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"
|
||||
|
||||
# Corresponding block diagram
|
||||
#
|
||||
DIAGRAM="a-m-c-w.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="moon carol"
|
||||
Reference in New Issue
Block a user