added ikev1/dpd-restart scenario
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
The peer <b>carol</b> and <b>moon</b> both have dynamic IP addresses, so that the remote end
|
||||||
|
is defined symbolically by <b>right=%<hostname></b>. The ipsec starter resolves the
|
||||||
|
fully-qualified hostname into the current IP address via a DNS lookup (simulated by an
|
||||||
|
/etc/hosts entry). Since the peer IP addresses are expected to change over time, the option
|
||||||
|
<b>rightallowany=yes</b> will allow an IKE main mode rekeying to arrive from an arbitrary
|
||||||
|
IP address under the condition that the peer identity remains unchanged. When this happens
|
||||||
|
the old tunnel is replaced by an IPsec connection to the new origin.
|
||||||
|
<p>
|
||||||
|
In this scenario <b>moon</b> first initiates a tunnel to <b>carol</b>. After some time
|
||||||
|
the responder <b>carol</b> disconnects (simulated by iptables blocking IKE and ESP traffic).
|
||||||
|
<b>moon</b> detects via Dead Peer Detection (DPD) that the connection is down and tries to
|
||||||
|
reconnect. After a few seconds the firewall is opened again and the connection is
|
||||||
|
reestablished.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
moon::ipsec status::STATE_MAIN_I4 (ISAKMP SA established)::YES
|
||||||
|
carol::iptables -I INPUT 1 -i eth0 -s PH_IP_MOON -j DROP::no output expected::NO
|
||||||
|
moon::sleep 35::no output expected::NO
|
||||||
|
carol::iptables -D INPUT 1::no output expected::NO
|
||||||
|
moon::cat /var/log/auth.log::inserting event EVENT_DPD::YES
|
||||||
|
moon::cat /var/log/auth.log::DPD: No response from peer - declaring peer dead::YES
|
||||||
|
moon::cat /var/log/auth.log::DPD: Terminating all SAs using this connection::YES
|
||||||
|
moon::cat /var/log/auth.log::DPD: Restarting connection::YES
|
||||||
|
moon::sleep 5::no output expected::NO
|
||||||
|
moon::ipsec status::STATE_MAIN_I4 (ISAKMP SA established)::YES
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# /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 moon
|
||||||
|
left=%defaultroute
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftsourceip=PH_IP_CAROL1
|
||||||
|
leftcert=carolCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%moon.strongswan.org
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -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
|
||||||
|
dpdaction=restart
|
||||||
|
dpddelay=5
|
||||||
|
dpdtimeout=25
|
||||||
|
|
||||||
|
conn carol
|
||||||
|
left=%defaultroute
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
leftsourceip=PH_IP_MOON1
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%carol.strongswan.org
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=PH_IP_CAROL1/32
|
||||||
|
auto=start
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
carol::ipsec stop
|
||||||
|
moon::ipsec stop
|
||||||
|
moon::/etc/init.d/iptables stop 2> /dev/null
|
||||||
|
carol::/etc/init.d/iptables stop 2> /dev/null
|
||||||
|
carol::ip addr del PH_IP_CAROL1/32 dev eth0
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
moon::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
carol::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
carol::ipsec start
|
||||||
|
moon::ipsec start
|
||||||
|
moon::sleep 4
|
||||||
@@ -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"
|
||||||
|
|
||||||
|
# UML instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol"
|
||||||
Reference in New Issue
Block a user