testing: Reorganizing IKEv1 and IKEv2 examples
For documentation purposes the new folders ikev1-algs, ikev2-algs, ikev1-multi-ca and ikev2-multi-ca have been created. Most of the test cases have now been converted to the vici interface. The remaining legacy stroke scenarios yet to be converted have been put into the ikev2-stroke-bye folder. For documentation purposes some legacy stroke scenarios will be kept in the ikev1-stroke, ikev2-stroke and ipv6-stroke folders.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
The hosts <b>alice</b>, <b>venus</b>, <b>carol</b>, and <b>dave</b> set up tunnel connections
|
||||
to gateway <b>moon</b> in a <b>hub-and-spoke</b> fashion. Each host requests a <b>virtual IP</b>
|
||||
with the <b>leftsourceip=%config</b> parameter. Gateway <b>moon</b> assigns virtual
|
||||
IP addresses from a pool named <b>extpool</b> [10.3.0.1..10.3.1.244] to hosts connecting
|
||||
to the <b>eth0</b> (PH_IP_MOON) interface and virtual IP addresses from a pool named <b>intpool</b>
|
||||
[10.4.0.1..10.4.1.244] to hosts connecting to the <b>eth1</b> (PH_IP_MOON1) interface.
|
||||
Thus <b>carol</b> and <b>dave</b> are assigned <b>PH_IP_CAROL1</b> and <b>PH_IP_DAVE1</b>,
|
||||
respectively, whereas <b>alice</b> and <b>venus</b> get <b>10.4.0.1</b> and <b>10.4.0.2</b>,
|
||||
respectively.
|
||||
<p>
|
||||
By defining the composite IPsec SA: <b>rightsubnet=10.3.0.0/16,10.4.0.0/16</b>, each of the four
|
||||
spokes can securely reach any other spoke via the central hub <b>moon</b>. This is
|
||||
demonstrated by <b>alice</b> and <b>dave</b> pinging the assigned virtual IP addresses
|
||||
of <b>carol</b> and <b>venus</b>.
|
||||
@@ -0,0 +1,43 @@
|
||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||
alice::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||
venus::ipsec status 2> /dev/null::home.*ESTABLISHED.*venus.strongswan.org.*moon.strongswan.org::YES
|
||||
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||
alice::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||
venus::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||
moon:: ipsec status 2> /dev/null::ext\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||
moon:: ipsec status 2> /dev/null::ext\[2]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||
moon:: ipsec status 2> /dev/null::int\[3]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||
moon:: ipsec status 2> /dev/null::int\[4]: ESTABLISHED.*moon.strongswan.org.*venus.strongswan.org::YES
|
||||
moon:: ipsec status 2> /dev/null::ext[{]1}.*INSTALLED. TUNNEL::YES
|
||||
moon:: ipsec status 2> /dev/null::ext[{]2}.*INSTALLED. TUNNEL::YES
|
||||
moon:: ipsec status 2> /dev/null::int[{]3}.*INSTALLED, TUNNEL::YES
|
||||
moon:: ipsec status 2> /dev/null::int[{]4}.*INSTALLED, TUNNEL::YES
|
||||
moon:: ipsec pool --status 2> /dev/null::extpool.*10.3.0.1.*10.3.1.244.*48h.*2::YES
|
||||
moon:: ipsec pool --status 2> /dev/null::intpool.*10.4.0.1.*10.4.1.244.*static.*2::YES
|
||||
moon:: ipsec pool --leases --filter pool=extpool,addr=10.3.0.1,[email protected] 2> /dev/null::online::YES
|
||||
moon:: ipsec pool --leases --filter pool=extpool,addr=10.3.0.2,[email protected] 2> /dev/null::online::YES
|
||||
moon:: ipsec pool --leases --filter pool=intpool,addr=10.4.0.1,[email protected] 2> /dev/null::online::YES
|
||||
moon:: ipsec pool --leases --filter pool=intpool,addr=10.4.0.2,id=venus.strongswan.org 2> /dev/null::online::YES
|
||||
carol::cat /var/log/daemon.log::installing new virtual IP 10.3.0.1::YES
|
||||
dave:: cat /var/log/daemon.log::installing new virtual IP 10.3.0.2::YES
|
||||
alice::cat /var/log/daemon.log::installing new virtual IP 10.4.0.1::YES
|
||||
venus::cat /var/log/daemon.log::installing new virtual IP 10.4.0.2::YES
|
||||
carol::cat /var/log/daemon.log::installing DNS server PH_IP_WINNETOU to /etc/resolv.conf::YES
|
||||
dave:: cat /var/log/daemon.log::installing DNS server PH_IP_WINNETOU to /etc/resolv.conf::YES
|
||||
alice::cat /var/log/daemon.log::installing DNS server PH_IP_ALICE to /etc/resolv.conf::YES
|
||||
venus::cat /var/log/daemon.log::installing DNS server PH_IP_VENUS to /etc/resolv.conf::YES
|
||||
alice::ping -c 1 PH_IP_CAROL1::64 bytes from PH_IP_CAROL1: icmp_.eq=1::YES
|
||||
dave:: ping -c 1 PH_IP_CAROL1::64 bytes from PH_IP_CAROL1: icmp_.eq=1::YES
|
||||
alice::ping -c 1 10.4.0.2::64 bytes from 10.4.0.2: icmp_.eq=1::YES
|
||||
dave:: ping -c 1 10.4.0.2::64 bytes from 10.4.0.2: icmp_.eq=1::YES
|
||||
alice::tcpdump::IP alice.strongswan.org > moon1.strongswan.org: ESP::YES
|
||||
alice::tcpdump::IP moon1.strongswan.org > alice.strongswan.org: ESP::YES
|
||||
dave::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
|
||||
dave::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
|
||||
carol::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
|
||||
carol::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
||||
venus::tcpdump::IP moon1.strongswan.org > venus.strongswan.org: ESP::YES
|
||||
venus::tcpdump::IP venus.strongswan.org > moon1.strongswan.org: ESP::YES
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
|
||||
conn home
|
||||
left=%defaultroute
|
||||
leftsourceip=%config
|
||||
leftcert=aliceCert.pem
|
||||
[email protected]
|
||||
leftfirewall=yes
|
||||
right=PH_IP_MOON1
|
||||
[email protected]
|
||||
rightsubnet=10.3.0.0/16,10.4.0.0/16
|
||||
auto=add
|
||||
@@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown resolve
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
|
||||
conn home
|
||||
left=PH_IP_CAROL
|
||||
leftsourceip=%config
|
||||
leftcert=carolCert.pem
|
||||
[email protected]
|
||||
leftfirewall=yes
|
||||
right=PH_IP_MOON
|
||||
[email protected]
|
||||
rightsubnet=10.3.0.0/16,10.4.0.0/16
|
||||
auto=add
|
||||
@@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = random nonce aes md5 sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown resolve
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
|
||||
conn home
|
||||
left=PH_IP_DAVE
|
||||
leftsourceip=%config
|
||||
leftcert=daveCert.pem
|
||||
[email protected]
|
||||
leftfirewall=yes
|
||||
right=PH_IP_MOON
|
||||
[email protected]
|
||||
rightsubnet=10.3.0.0/16,10.4.0.0/16
|
||||
auto=add
|
||||
@@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown resolve
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
leftcert=moonCert.pem
|
||||
[email protected]
|
||||
leftfirewall=yes
|
||||
right=%any
|
||||
|
||||
conn int
|
||||
left=PH_IP_MOON1
|
||||
leftsubnet=10.3.0.0/16,10.4.0.0/16
|
||||
rightsourceip=%intpool
|
||||
auto=add
|
||||
|
||||
conn ext
|
||||
left=PH_IP_MOON
|
||||
leftsubnet=10.3.0.0/16,10.4.0.0/16
|
||||
rightsourceip=%extpool
|
||||
auto=add
|
||||
@@ -0,0 +1,43 @@
|
||||
*filter
|
||||
|
||||
# default policy is DROP
|
||||
-P INPUT DROP
|
||||
-P OUTPUT DROP
|
||||
-P FORWARD DROP
|
||||
|
||||
# allow esp
|
||||
-A INPUT -i eth0 -p 50 -j ACCEPT
|
||||
-A OUTPUT -o eth0 -p 50 -j ACCEPT
|
||||
-A INPUT -i eth1 -p 50 -j ACCEPT
|
||||
-A OUTPUT -o eth1 -p 50 -j ACCEPT
|
||||
|
||||
# allow IKE
|
||||
-A INPUT -i eth0 -p udp --sport 500 --dport 500 -j ACCEPT
|
||||
-A OUTPUT -o eth0 -p udp --dport 500 --sport 500 -j ACCEPT
|
||||
-A INPUT -i eth1 -p udp --sport 500 --dport 500 -j ACCEPT
|
||||
-A OUTPUT -o eth1 -p udp --dport 500 --sport 500 -j ACCEPT
|
||||
|
||||
# allow MobIKE
|
||||
-A INPUT -i eth0 -p udp --sport 4500 --dport 4500 -j ACCEPT
|
||||
-A OUTPUT -o eth0 -p udp --dport 4500 --sport 4500 -j ACCEPT
|
||||
-A INPUT -i eth1 -p udp --sport 4500 --dport 4500 -j ACCEPT
|
||||
-A OUTPUT -o eth1 -p udp --dport 4500 --sport 4500 -j ACCEPT
|
||||
|
||||
# allow crl fetch from winnetou
|
||||
-A INPUT -i eth0 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
|
||||
-A OUTPUT -o eth0 -p tcp --dport 80 -d PH_IP_WINNETOU -j ACCEPT
|
||||
-A FORWARD -i eth0 -o eth1 -p tcp --sport 80 -s PH_IP_WINNETOU -j ACCEPT
|
||||
-A FORWARD -o eth0 -i eth1 -p tcp --dport 80 -d PH_IP_WINNETOU -j ACCEPT
|
||||
|
||||
# allow ssh
|
||||
-A INPUT -p tcp --dport 22 -j ACCEPT
|
||||
-A OUTPUT -p tcp --sport 22 -j ACCEPT
|
||||
|
||||
COMMIT
|
||||
|
||||
*nat
|
||||
|
||||
# masquerade crl fetches to winnetou
|
||||
-A POSTROUTING -o eth0 -s 10.1.0.0/16 -d PH_IP_WINNETOU -j MASQUERADE
|
||||
|
||||
COMMIT
|
||||
@@ -0,0 +1,15 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke sqlite attr-sql kernel-netlink socket-default updown
|
||||
|
||||
plugins {
|
||||
attr-sql {
|
||||
database = sqlite:///etc/db.d/ipsec.db
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pool {
|
||||
load = sqlite
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
|
||||
conn home
|
||||
left=%defaultroute
|
||||
leftsourceip=%config
|
||||
leftcert=venusCert.pem
|
||||
[email protected]
|
||||
leftfirewall=yes
|
||||
right=PH_IP_MOON1
|
||||
[email protected]
|
||||
rightsubnet=10.3.0.0/16,10.4.0.0/16
|
||||
auto=add
|
||||
@@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown resolve
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
alice::ipsec stop
|
||||
venus::ipsec stop
|
||||
carol::ipsec stop
|
||||
dave::ipsec stop
|
||||
moon::ipsec stop
|
||||
alice::iptables-restore < /etc/iptables.flush
|
||||
venus::iptables-restore < /etc/iptables.flush
|
||||
moon::iptables-restore < /etc/iptables.flush
|
||||
carol::iptables-restore < /etc/iptables.flush
|
||||
dave::iptables-restore < /etc/iptables.flush
|
||||
moon::ip route del 10.3.0.0/16 via PH_IP_MOON
|
||||
moon::ip route del 10.4.0.0/16 via PH_IP_MOON1
|
||||
moon::ipsec pool --del extpool 2> /dev/null
|
||||
moon::ipsec pool --del intpool 2> /dev/null
|
||||
moon::ipsec pool --delattr dns --server PH_IP_VENUS --pool intpool --identity venus.strongswan.org 2> /dev/null
|
||||
moon::ipsec pool --delattr dns --server PH_IP_ALICE --pool intpool --identity [email protected] 2> /dev/null
|
||||
moon::ipsec pool --delattr dns --server PH_IP_WINNETOU --pool extpool 2> /dev/null
|
||||
@@ -0,0 +1,30 @@
|
||||
moon::cat /usr/local/share/strongswan/templates/database/sql/sqlite.sql > /etc/db.d/ipsec.sql
|
||||
moon::cat /etc/db.d/ipsec.sql | sqlite3 /etc/db.d/ipsec.db
|
||||
moon::ipsec pool --add extpool --start 10.3.0.1 --end 10.3.1.244 --timeout 48 2> /dev/null
|
||||
moon::ipsec pool --add intpool --start 10.4.0.1 --end 10.4.1.244 --timeout 0 2> /dev/null
|
||||
moon::ipsec pool --addattr dns --server PH_IP_VENUS --pool intpool --identity venus.strongswan.org 2> /dev/null
|
||||
moon::ipsec pool --addattr dns --server PH_IP_ALICE --pool intpool --identity [email protected] 2> /dev/null
|
||||
moon::ipsec pool --addattr dns --server PH_IP_WINNETOU --pool extpool 2> /dev/null
|
||||
moon::ipsec pool --statusattr 2> /dev/null
|
||||
moon::ip route add 10.3.0.0/16 via PH_IP_MOON
|
||||
moon::ip route add 10.4.0.0/16 via PH_IP_MOON1
|
||||
alice::iptables-restore < /etc/iptables.rules
|
||||
venus::iptables-restore < /etc/iptables.rules
|
||||
moon::iptables-restore < /etc/iptables.rules
|
||||
carol::iptables-restore < /etc/iptables.rules
|
||||
dave::iptables-restore < /etc/iptables.rules
|
||||
moon::ipsec start
|
||||
alice::ipsec start
|
||||
venus::ipsec start
|
||||
carol::ipsec start
|
||||
dave::ipsec start
|
||||
moon::expect-connection int
|
||||
moon::expect-connection ext
|
||||
carol::expect-connection home
|
||||
carol::ipsec up home
|
||||
dave::expect-connection home
|
||||
dave::ipsec up home
|
||||
alice::expect-connection home
|
||||
alice::ipsec up home
|
||||
venus::expect-connection home
|
||||
venus::ipsec up home
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This configuration file provides information on the
|
||||
# guest instances used for this test
|
||||
|
||||
# All guest instances that are required for this test
|
||||
#
|
||||
VIRTHOSTS="alice moon carol winnetou dave"
|
||||
|
||||
# Corresponding block diagram
|
||||
#
|
||||
DIAGRAM="a-v-m-c-w-d.png"
|
||||
|
||||
# Guest instances on which tcpdump is to be started
|
||||
#
|
||||
TCPDUMPHOSTS="alice venus carol dave"
|
||||
|
||||
# Guest instances on which IPsec is started
|
||||
# Used for IPsec logging purposes
|
||||
#
|
||||
IPSECHOSTS="alice venus moon carol dave"
|
||||
|
||||
# Guest instances on which databases are used
|
||||
#
|
||||
DBHOSTS="moon"
|
||||
Reference in New Issue
Block a user