added new test scenarios
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
The roadwarriors <b>alice</b> and <b>venus</b> sitting behind the NAT router <b>moon</b> set up
|
||||||
|
tunnels to gateway <b>sun</b>. UDP encapsulation is used to traverse the NAT router.
|
||||||
|
Both roadwarriors share the same Pre-Shared Key (PSK) with the gateway <b>sun</b>.
|
||||||
|
<b>leftfirewall=yes</b> automatically inserts iptables-based firewall rules that let pass
|
||||||
|
the tunneled traffic. In order to test the tunnel, the NAT-ed hosts <b>alice</b> and <b>venus</b>
|
||||||
|
ping the client <b>bob</b> behind the gateway <b>sun</b>.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
alice::ipsec statusall::nat-t.*INSTALLED::YES
|
||||||
|
venus::ipsec statusall::nat-t.*INSTALLED::YES
|
||||||
|
sun::ipsec statusall::nat-t.*INSTALLED::YES
|
||||||
|
sun::ipsec status::nat-t.*\[PH_IP_ALICE\]::YES
|
||||||
|
sun::ipsec status::nat-t.*\[PH_IP_VENUS\]::YES
|
||||||
|
alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_seq=1::YES
|
||||||
|
venus::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_seq=1::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org.* > sun.strongswan.org.ipsec-nat-t: UDP::YES
|
||||||
|
moon::tcpdump::IP sun.strongswan.org.ipsec-nat-t > moon.strongswan.org.*: UDP::YES
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn nat-t
|
||||||
|
left=%defaultroute
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_SUN
|
||||||
|
rightsubnet=10.2.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
PH_IP_ALICE : PSK 0sv+NkxY9LLZvwj4qCC2o/gGrWDF2d21jL
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn nat-t
|
||||||
|
left=PH_IP_SUN
|
||||||
|
leftsubnet=10.2.0.0/16
|
||||||
|
leftfirewall=yes
|
||||||
|
leftnexthop=%direct
|
||||||
|
right=%any
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
PH_IP_ALICE : PSK 0sv+NkxY9LLZvwj4qCC2o/gGrWDF2d21jL
|
||||||
|
|
||||||
|
PH_IP_VENUS : PSK 0s8PjpI8z+Ym5A9zPvh7+opyyV9NcZp8Br
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn nat-t
|
||||||
|
left=%defaultroute
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_SUN
|
||||||
|
rightsubnet=10.2.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
PH_IP_VENUS : PSK 0s8PjpI8z+Ym5A9zPvh7+opyyV9NcZp8Br
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
alice::iptables -v -n -L
|
||||||
|
venus::iptables -v -n -L
|
||||||
|
sun::iptables -v -n -L
|
||||||
|
sun::ipsec stop
|
||||||
|
alice::ipsec stop
|
||||||
|
venus::ipsec stop
|
||||||
|
alice::/etc/init.d/iptables stop 2> /dev/null
|
||||||
|
venus::/etc/init.d/iptables stop 2> /dev/null
|
||||||
|
sun::/etc/init.d/iptables stop 2> /dev/null
|
||||||
|
moon::iptables -t nat -F
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
alice::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
venus::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
sun::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
moon::echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p udp -j SNAT --to-source PH_IP_MOON:1024-1100
|
||||||
|
moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p tcp -j SNAT --to-source PH_IP_MOON:2000-2100
|
||||||
|
alice::rm /etc/ipsec.d/cacerts/*
|
||||||
|
venus::rm /etc/ipsec.d/cacerts/*
|
||||||
|
sun::rm /etc/ipsec.d/cacerts/*
|
||||||
|
alice::ipsec start
|
||||||
|
venus::ipsec start
|
||||||
|
sun::ipsec start
|
||||||
|
alice::sleep 2
|
||||||
|
alice::ipsec up nat-t
|
||||||
|
venus::sleep 2
|
||||||
|
venus::ipsec up nat-t
|
||||||
|
venus::sleep 2
|
||||||
@@ -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 venus moon winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-v-m-w-s-b.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="alice venus sun"
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
The roadwarriors <b>alice</b> and <b>venus</b> sitting behind the NAT router <b>moon</b> set up
|
||||||
|
tunnels to gateway <b>sun</b>. UDP encapsulation is used to traverse the NAT router.
|
||||||
|
<b>leftfirewall=yes</b> automatically inserts iptables-based firewall rules that let pass
|
||||||
|
the tunneled traffic. In order to test the tunnel, the NAT-ed hosts <b>alice</b> and <b>venus</b>
|
||||||
|
ping the client <b>bob</b> behind the gateway <b>sun</b>.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
alice::ipsec statusall::nat-t.*INSTALLED::YES
|
||||||
|
venus::ipsec statusall::nat-t.*INSTALLED::YES
|
||||||
|
sun::ipsec statusall::nat-t.*INSTALLED::YES
|
||||||
|
sun::ipsec status::[email protected]::YES
|
||||||
|
sun::ipsec status::@venus.strongswan.org::YES
|
||||||
|
alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_seq=1::YES
|
||||||
|
venus::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_seq=1::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org.* > sun.strongswan.org.ipsec-nat-t: UDP::YES
|
||||||
|
moon::tcpdump::IP sun.strongswan.org.ipsec-nat-t > moon.strongswan.org.*: UDP::YES
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# /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 nat-t
|
||||||
|
left=%defaultroute
|
||||||
|
leftcert=aliceCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_SUN
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.2.0.0/16
|
||||||
|
auto=add
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
# /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
|
||||||
|
left=PH_IP_SUN
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
leftsubnet=10.2.0.0/16
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn nat-t
|
||||||
|
leftsubnet=10.2.0.0/16
|
||||||
|
right=%any
|
||||||
|
rightsubnetwithin=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# /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 nat-t
|
||||||
|
left=%defaultroute
|
||||||
|
leftcert=venusCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_SUN
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.2.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
alice::iptables -v -n -L
|
||||||
|
venus::iptables -v -n -L
|
||||||
|
sun::iptables -v -n -L
|
||||||
|
sun::ipsec stop
|
||||||
|
alice::ipsec stop
|
||||||
|
venus::ipsec stop
|
||||||
|
alice::/etc/init.d/iptables stop 2> /dev/null
|
||||||
|
venus::/etc/init.d/iptables stop 2> /dev/null
|
||||||
|
sun::/etc/init.d/iptables stop 2> /dev/null
|
||||||
|
moon::iptables -t nat -F
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
alice::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
venus::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
sun::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
moon::echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
|
moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p udp -j SNAT --to-source PH_IP_MOON:1024-1100
|
||||||
|
moon::iptables -t nat -A POSTROUTING -o eth0 -s 10.1.0.0/16 -p tcp -j SNAT --to-source PH_IP_MOON:2000-2100
|
||||||
|
alice::ipsec start
|
||||||
|
venus::ipsec start
|
||||||
|
sun::ipsec start
|
||||||
|
alice::sleep 2
|
||||||
|
alice::ipsec up nat-t
|
||||||
|
venus::sleep 2
|
||||||
|
venus::ipsec up nat-t
|
||||||
|
venus::sleep 2
|
||||||
@@ -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 venus moon winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-v-m-w-s-b.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="alice venus sun"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
Using the <b>left|rightprotoport</b> selectors, two IPsec tunnels
|
||||||
|
between the roadwarrior <b>carol</b> and the gateway <b>moon</b> are
|
||||||
|
defined. The first IPsec SA is restricted to ICMP packets and the second
|
||||||
|
covers TCP-based SSH connections. The established tunnels are tested
|
||||||
|
by <b>carol</b> by first pinging <b>alice</b> behind <b>moon</b> and
|
||||||
|
then setting up an SSH session to the same client.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
carol::ipsec statusall::home-icmp.*INSTALLED::YES
|
||||||
|
carol::ipsec statusall::home-ssh.*INSTALLED::YES
|
||||||
|
moon::ipsec statusall::rw-icmp.*INSTALLED::YES
|
||||||
|
moon::ipsec statusall::rw-ssh.*INSTALLED::YES
|
||||||
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
|
||||||
|
carol::ping -c 1 PH_IP_MOON1::64 bytes from PH_IP_MOON1: icmp_seq=1::YES
|
||||||
|
carol::ssh -o ConnectTimeout=5 PH_IP_ALICE hostname::alice::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,29 @@
|
|||||||
|
# /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
|
||||||
|
left=PH_IP_CAROL
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftcert=carolCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn home-icmp
|
||||||
|
leftprotoport=icmp
|
||||||
|
rightprotoport=icmp
|
||||||
|
|
||||||
|
conn home-ssh
|
||||||
|
leftprotoport=tcp
|
||||||
|
rightprotoport=tcp/ssh
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# /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
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
right=%any
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn rw-icmp
|
||||||
|
lefthostaccess=yes
|
||||||
|
leftprotoport=icmp
|
||||||
|
rightprotoport=icmp
|
||||||
|
|
||||||
|
conn rw-ssh
|
||||||
|
leftprotoport=tcp/ssh
|
||||||
|
rightprotoport=tcp
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
carol::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
carol::sleep 2
|
||||||
|
carol::ipsec up home-icmp
|
||||||
|
carol::ipsec up home-ssh
|
||||||
@@ -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"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Using the <b>left|rightprotoport</b> selectors, two IPsec tunnels
|
||||||
|
between the roadwarrior <b>carol</b> and the gateway <b>moon</b> are
|
||||||
|
defined. The first IPsec SA is restricted to ICMP packets and the second
|
||||||
|
covers TCP-based SSH connections. Using <b>add=route</b> %trap
|
||||||
|
eroutes for these IPsec SAs are prepared on <b>carol</b>. By sending
|
||||||
|
a ping to the client <b>alice</b> behind <b>moon</b>, the ICMP eroute
|
||||||
|
is triggered and the corresponding IPsec tunnel is set up. In the same
|
||||||
|
way an ssh session to <b>alice</b> over the second IPsec SA is established.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq::YES
|
||||||
|
carol::ping -c 1 PH_IP_MOON1::64 bytes from PH_IP_MOON1: icmp_seq::YES
|
||||||
|
carol::ssh PH_IP_ALICE hostname::alice::YES
|
||||||
|
carol::cat /var/log/auth.log::acquiring CHILD_SA::YES
|
||||||
|
carol::ipsec statusall::home-icmp.*INSTALLED::YES
|
||||||
|
carol::ipsec statusall::home-ssh.*INSTALLED::YES
|
||||||
|
moon::ipsec statusall::rw-icmp.*INSTALLED::YES
|
||||||
|
moon::ipsec statusall::rw-ssh.*INSTALLED::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,29 @@
|
|||||||
|
# /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
|
||||||
|
left=PH_IP_CAROL
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftcert=carolCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
[email protected]
|
||||||
|
auto=route
|
||||||
|
|
||||||
|
conn home-icmp
|
||||||
|
leftprotoport=icmp
|
||||||
|
rightprotoport=icmp
|
||||||
|
|
||||||
|
conn home-ssh
|
||||||
|
leftprotoport=tcp
|
||||||
|
rightprotoport=tcp/ssh
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# /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
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
right=%any
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn rw-icmp
|
||||||
|
lefthostaccess=yes
|
||||||
|
leftprotoport=icmp
|
||||||
|
rightprotoport=icmp
|
||||||
|
|
||||||
|
conn rw-ssh
|
||||||
|
leftprotoport=tcp/ssh
|
||||||
|
rightprotoport=tcp
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
moon::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
carol::/etc/init.d/iptables start 2> /dev/null
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
carol::sleep 1
|
||||||
|
carol::ssh PH_IP_ALICE hostname
|
||||||
|
carol::ping -c 1 PH_IP_ALICE > /dev/null
|
||||||
|
carol::sleep 2
|
||||||
@@ -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"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
The roadwarriors <b>carol</b> and <b>dave</b> set up a connection each
|
||||||
|
to gateway <b>moon</b>. The authentication is based on distinct <b>pre-shared keys</b>
|
||||||
|
and fully qualified domain names. Upon the successful establishment of the IPsec tunnels,
|
||||||
|
<b>leftfirewall=yes</b> automatically inserts iptables-based firewall rules that
|
||||||
|
let pass the tunneled traffic. In order to test both tunnel and firewall, both
|
||||||
|
<b>carol</b> and <b>dave</b> ping the client <b>alice</b> behind the gateway <b>moon</b>.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
moon::ipsec statusall::rw.*ESTABLISHED::YES
|
||||||
|
carol::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
dave::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
|
||||||
|
dave::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
|
||||||
|
moon::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_CAROL
|
||||||
|
leftnexthop=%direct
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
[email protected] : PSK 0sFpZAZqEN6Ti9sqt4ZP5EWcqx
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# /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
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_DAVE
|
||||||
|
leftnexthop=%direct
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
[email protected] : PSK 0sjVzONCF02ncsgiSlmIXeqhGN
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn rw
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftnexthop=%direct
|
||||||
|
[email protected]
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%any
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
[email protected] : PSK 0sFpZAZqEN6Ti9sqt4ZP5EWcqx
|
||||||
|
|
||||||
|
[email protected] : PSK 0sjVzONCF02ncsgiSlmIXeqhGN
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
moon::iptables -v -n -L
|
||||||
|
carol::iptables -v -n -L
|
||||||
|
dave::iptables -v -n -L
|
||||||
|
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
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
|
moon::rm /etc/ipsec.d/cacerts/*
|
||||||
|
carol::rm /etc/ipsec.d/cacerts/*
|
||||||
|
dave::rm /etc/ipsec.d/cacerts/*
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
dave::ipsec start
|
||||||
|
carol::sleep 1
|
||||||
|
carol::ipsec up home
|
||||||
|
dave::ipsec up home
|
||||||
|
carol::sleep 1
|
||||||
@@ -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"
|
||||||
|
|
||||||
|
# UML instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol dave"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
The roadwarriors <b>carol</b> and <b>dave</b> set up a connection each
|
||||||
|
to gateway <b>moon</b>. The authentication is based on distinct <b>pre-shared keys</b>
|
||||||
|
and IPv4 addresses. Upon the successful establishment of the IPsec tunnels,
|
||||||
|
<b>leftfirewall=yes</b> automatically inserts iptables-based firewall rules that
|
||||||
|
let pass the tunneled traffic. In order to test both tunnel and firewall, both
|
||||||
|
<b>carol</b> and <b>dave</b> ping the client <b>alice</b> behind the gateway <b>moon</b>.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
moon::ipsec statusall::rw.*ESTABLISHED::YES
|
||||||
|
carol::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
dave::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
|
||||||
|
dave::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
|
||||||
|
moon::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_CAROL
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
192.168.0.100 : PSK 0sFpZAZqEN6Ti9sqt4ZP5EWcqx
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# /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
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_DAVE
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
192.168.0.200 : PSK 0sjVzONCF02ncsgiSlmIXeqhGN
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn rw
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%any
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
192.168.0.100 : PSK 0sFpZAZqEN6Ti9sqt4ZP5EWcqx
|
||||||
|
|
||||||
|
192.168.0.200 : PSK 0sjVzONCF02ncsgiSlmIXeqhGN
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
moon::iptables -v -n -L
|
||||||
|
carol::iptables -v -n -L
|
||||||
|
dave::iptables -v -n -L
|
||||||
|
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
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
|
moon::rm /etc/ipsec.d/cacerts/*
|
||||||
|
carol::rm /etc/ipsec.d/cacerts/*
|
||||||
|
dave::rm /etc/ipsec.d/cacerts/*
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
dave::ipsec start
|
||||||
|
carol::sleep 1
|
||||||
|
carol::ipsec up home
|
||||||
|
dave::ipsec up home
|
||||||
|
carol::sleep 1
|
||||||
@@ -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"
|
||||||
|
|
||||||
|
# UML instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol dave"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
The roadwarriors <b>carol</b> and <b>dave</b> each set up a connection to gateway <b>moon</b>.
|
||||||
|
<b>carol</b>'s authentication is based on a Pre-Shared Key (<b>PSK</b>) whereas <b>dave</b>'s
|
||||||
|
is based on an RSA signature (<b>RSASIG</b>). Gateway <b>moon</b> supports both authentication modes
|
||||||
|
and selects the correct roadwarrior connection definition based on the gateway ID
|
||||||
|
requested by the roadwarrior.
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
moon::cat /var/log/auth.log::authentication of '[email protected]' with pre-shared key successful::YES
|
||||||
|
moon::cat /var/log/auth.log::authentication of 'PH_IP_MOON' with pre-shared key (myself)::YES
|
||||||
|
moon::ipsec statusall::rw-psk.*INSTALLED::YES
|
||||||
|
carol::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
moon::cat /var/log/auth.log::authentication of '[email protected]' with RSA signature successful::YES
|
||||||
|
moon::cat /var/log/auth.log::authentication of '@moon.strongswan.org' with RSA signature (myself)::YES
|
||||||
|
moon::ipsec statusall::rw-rsasig.*INSTALLED::YES
|
||||||
|
dave::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
|
||||||
|
dave::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
|
||||||
|
moon::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_CAROL
|
||||||
|
leftnexthop=%direct
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
[email protected] : PSK 0sFpZAZqEN6Ti9sqt4ZP5EWcqx
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
strictcrlpolicy=no
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_DAVE
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftcert=daveCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
keyexchange=ikev2
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# /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
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%any
|
||||||
|
|
||||||
|
conn rw-rsasig
|
||||||
|
authby=rsasig
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn rw-psk
|
||||||
|
authby=secret
|
||||||
|
leftid=PH_IP_MOON
|
||||||
|
auto=add
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
: RSA moonKey.pem
|
||||||
|
|
||||||
|
[email protected] : PSK 0sFpZAZqEN6Ti9sqt4ZP5EWcqx
|
||||||
|
|
||||||
|
[email protected] : PSK 0sjVzONCF02ncsgiSlmIXeqhGN
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
moon::iptables -v -n -L
|
||||||
|
carol::iptables -v -n -L
|
||||||
|
dave::iptables -v -n -L
|
||||||
|
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
|
||||||
|
moon::rm /etc/ipsec.d/crls/*
|
||||||
|
carol::rm /etc/ipsec.d/crls/*
|
||||||
|
dave::rm /etc/ipsec.d/crls/*
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
|
moon::wget -q http://crl.strongswan.org/strongswan.crl -O /etc/ipsec.d/crls/strongswan.crl
|
||||||
|
carol::wget -q http://crl.strongswan.org/strongswan.crl -O /etc/ipsec.d/crls/strongswan.crl
|
||||||
|
dave::wget -q http://crl.strongswan.org/strongswan.crl -O /etc/ipsec.d/crls/strongswan.crl
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
dave::ipsec start
|
||||||
|
carol::sleep 1
|
||||||
|
carol::ipsec up home
|
||||||
|
dave::ipsec up home
|
||||||
|
carol::sleep 1
|
||||||
@@ -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"
|
||||||
|
|
||||||
|
# UML instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol dave"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
The roadwarriors <b>carol</b> and <b>dave</b> set up a connection each
|
||||||
|
to gateway <b>moon</b>. The roadwarriors' authentication is based on
|
||||||
|
<ib>Pre-Shared Keys</b> (PSK) whereas the gateway uses an <b>RSA signature</b>
|
||||||
|
(RSASIG) certified by an X.509 certificate.
|
||||||
|
Upon the successful establishment of the IPsec tunnels, <b>leftfirewall=yes</b>
|
||||||
|
automatically inserts iptables-based firewall rules that let pass the tunneled traffic.
|
||||||
|
In order to test both tunnel and firewall, both <b>carol</b> and <b>dave</b> ping
|
||||||
|
the client <b>alice</b> behind the gateway <b>moon</b>.
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
moon::cat /var/log/auth.log::authentication of '[email protected]' with pre-shared key successful::YES
|
||||||
|
moon::cat /var/log/auth.log::authentication of '[email protected]' with pre-shared key successful::YES
|
||||||
|
moon::cat /var/log/auth.log::authentication of '@moon.strongswan.org' with RSA signature (myself)::YES
|
||||||
|
moon::ipsec statusall::rw.*INSTALLED::YES
|
||||||
|
carol::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
dave::ipsec statusall::home.*ESTABLISHED::YES
|
||||||
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_seq=1::YES
|
||||||
|
dave::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
|
||||||
|
moon::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
plutostart=no
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_CAROL
|
||||||
|
leftnexthop=%direct
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
[email protected] : PSK 0sFpZAZqEN6Ti9sqt4ZP5EWcqx
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# /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
|
||||||
|
authby=secret
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_DAVE
|
||||||
|
leftnexthop=%direct
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
[email protected] : PSK 0sjVzONCF02ncsgiSlmIXeqhGN
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# /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 rw
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftnexthop=%direct
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%any
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
: RSA moonKey.pem
|
||||||
|
|
||||||
|
[email protected] : PSK 0sFpZAZqEN6Ti9sqt4ZP5EWcqx
|
||||||
|
|
||||||
|
[email protected] : PSK 0sjVzONCF02ncsgiSlmIXeqhGN
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
moon::iptables -v -n -L
|
||||||
|
carol::iptables -v -n -L
|
||||||
|
dave::iptables -v -n -L
|
||||||
|
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
|
||||||
|
moon::rm /etc/ipsec.d/crls/*
|
||||||
|
carol::rm /etc/ipsec.d/crls/*
|
||||||
|
dave::rm /etc/ipsec.d/crls/*
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
|
moon::wget -q http://crl.strongswan.org/strongswan.crl -O /etc/ipsec.d/crls/strongswan.crl
|
||||||
|
carol::wget -q http://crl.strongswan.org/strongswan.crl -O /etc/ipsec.d/crls/strongswan.crl
|
||||||
|
dave::wget -q http://crl.strongswan.org/strongswan.crl -O /etc/ipsec.d/crls/strongswan.crl
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
dave::ipsec start
|
||||||
|
carol::sleep 1
|
||||||
|
carol::ipsec up home
|
||||||
|
dave::ipsec up home
|
||||||
|
carol::sleep 1
|
||||||
@@ -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"
|
||||||
|
|
||||||
|
# UML instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol dave"
|
||||||
Reference in New Issue
Block a user