testing: Added legacy ipv6-stroke scenarios
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
An IPv6 ESP connection between the hosts <b>moon</b> and <b>sun</b> is successfully set up.
|
||||||
|
The authentication is based on X.509 certificates. Upon the successful establishment of
|
||||||
|
the IPsec tunnel, <b>leftfirewall=yes</b> automatically inserts ip6tables-based firewall
|
||||||
|
rules that let pass the tunneled traffic. In order to test both the host-to-host tunnel
|
||||||
|
and the firewall rules, <b>moon</b> sends an IPv6 ICMP request to <b>sun</b> using the ping6 command.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon::ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon::ipsec status 2> /dev/null::host-host.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::host-host.*INSTALLED, TUNNEL::YES
|
||||||
|
moon::ping6 -c 1 -p deadbeef ip6-sun.strongswan.org::64 bytes from ip6-sun.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
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=fec1::0/16
|
||||||
|
rightsubnet=fec2::0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_SUN
|
||||||
|
[email protected]
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=fec2::0/16
|
||||||
|
rightsubnet=fec1::0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_SUN
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
sun::ipsec stop
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.flush
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.drop
|
||||||
|
sun::iptables-restore < /etc/iptables.drop
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
moon::ipsec start
|
||||||
|
sun::ipsec start
|
||||||
|
moon::expect-connection host-host
|
||||||
|
sun::expect-connection host-host
|
||||||
|
moon::ipsec up host-host
|
||||||
@@ -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="moon winnetou sun"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="m-w-s-ip6.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
An IPv6 ESP connection between the hosts <b>moon</b> and <b>sun</b> is successfully set up.
|
||||||
|
The authentication is based on X.509 certificates. Upon the successful establishment of
|
||||||
|
the IPsec tunnel, <b>leftfirewall=yes</b> automatically inserts ip6tables-based firewall
|
||||||
|
rules that let pass the tunneled traffic. In order to test both the host-to-host tunnel
|
||||||
|
and the firewall rules, <b>moon</b> sends an IPv6 ICMP request to <b>sun</b> using the ping6 command.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon::ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon::ipsec status 2> /dev/null::host-host.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::host-host.*INSTALLED, TUNNEL::YES
|
||||||
|
moon::ping6 -c 1 -p deadbeef ip6-sun.strongswan.org::64 bytes from ip6-sun.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
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
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
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_SUN
|
||||||
|
[email protected]
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
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
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
sun::ipsec stop
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.flush
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.drop
|
||||||
|
sun::iptables-restore < /etc/iptables.drop
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
moon::ipsec start
|
||||||
|
sun::ipsec start
|
||||||
|
moon::expect-connection host-host
|
||||||
|
sun::expect-connection host-host
|
||||||
|
moon::ipsec up host-host
|
||||||
@@ -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="moon winnetou sun"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="m-w-s-ip6.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
An IPv6 ESP tunnel connection between the gateways <b>moon</b> and <b>sun</b> is successfully set up.
|
||||||
|
It connects the two subnets hiding behind their respective gateways. The authentication is based on
|
||||||
|
X.509 certificates. Upon the successful establishment of the IPsec tunnel, <b>leftfirewall=yes</b>
|
||||||
|
automatically inserts ip6tables-based firewall rules that let pass the tunneled traffic.
|
||||||
|
In order to test both the net-to-net tunnel and the firewall rules, client <b>alice</b> behind <b>moon</b>
|
||||||
|
sends an IPv6 ICMP request to client <b>bob</b> behind <b>sun</b> using the ping6 command.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*INSTALLED, TUNNEL::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
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=fec1::0/16
|
||||||
|
rightsubnet=fec2::0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_SUN
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=fec2::0/16
|
||||||
|
rightsubnet=fec1::0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_SUN
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
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"
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.flush
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.drop
|
||||||
|
sun::iptables-restore < /etc/iptables.drop
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
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::expect-connection net-net
|
||||||
|
sun::expect-connection net-net
|
||||||
|
moon::ipsec up net-net
|
||||||
@@ -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 winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-m-w-s-b-ip6.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
An IPv6 ESP tunnel connection between the gateways <b>moon</b> and <b>sun</b> is successfully set up.
|
||||||
|
It connects the two subnets hiding behind their respective gateways. The authentication is based on
|
||||||
|
X.509 certificates. Upon the successful establishment of the IPsec tunnel, <b>leftfirewall=yes</b>
|
||||||
|
automatically inserts ip6tables-based firewall rules that let pass the tunneled traffic.
|
||||||
|
In order to test both the net-to-net tunnel and the firewall rules, client <b>alice</b> behind <b>moon</b>
|
||||||
|
sends an IPv6 ICMP request to client <b>bob</b> behind <b>sun</b> using the ping6 command.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*INSTALLED, TUNNEL::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
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
fragmentation=yes
|
||||||
|
mobike=no
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=fec1::0/16
|
||||||
|
rightsubnet=fec2::0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_SUN
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
fragmentation=yes
|
||||||
|
mobike=no
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=fec2::0/16
|
||||||
|
rightsubnet=fec1::0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_SUN
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
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"
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.flush
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.drop
|
||||||
|
sun::iptables-restore < /etc/iptables.drop
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
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::expect-connection net-net
|
||||||
|
sun::expect-connection net-net
|
||||||
|
moon::ipsec up net-net
|
||||||
@@ -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 winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-m-w-s-b-ip6.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
An IPv6 ESP tunnel connection between the gateways <b>moon</b> and <b>sun</b> is successfully set up.
|
||||||
|
It connects the two IPv4 subnets hiding behind their respective gateways. The authentication is based on
|
||||||
|
X.509 certificates. In order to test the IPv4-over-IPv6 ESP tunnel, client <b>alice</b> behind <b>moon</b>
|
||||||
|
sends an IPv4 ICMP request to client <b>bob</b> behind <b>sun</b> using the ping command.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*INSTALLED, TUNNEL::YES
|
||||||
|
alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_.eq=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
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
rightsubnet=10.2.0.0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_SUN
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=10.2.0.0/16
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_SUN
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
sun::ipsec stop
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.flush
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.drop
|
||||||
|
sun::iptables-restore < /etc/iptables.drop
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
moon::ipsec start
|
||||||
|
sun::ipsec start
|
||||||
|
moon::expect-connection net-net
|
||||||
|
sun::expect-connection net-net
|
||||||
|
moon::ipsec up net-net
|
||||||
@@ -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 winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-m-w-s-b-ip4-in-ip6.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
An IPv6 ESP tunnel connection between the gateways <b>moon</b> and <b>sun</b> is successfully set up.
|
||||||
|
It connects the two IPv4 subnets hiding behind their respective gateways. The authentication is based on
|
||||||
|
X.509 certificates. In order to test the IPv4-over-IPv6 ESP tunnel, client <b>alice</b> behind <b>moon</b>
|
||||||
|
sends an IPv4 ICMP request to client <b>bob</b> behind <b>sun</b> using the ping command.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*INSTALLED, TUNNEL::YES
|
||||||
|
alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_.eq=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
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
mobike=no
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
rightsubnet=10.2.0.0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_SUN
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
mobike=no
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
also=host-host
|
||||||
|
leftsubnet=10.2.0.0/16
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
|
||||||
|
conn host-host
|
||||||
|
left=PH_IP6_SUN
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
sun::ipsec stop
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.flush
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.drop
|
||||||
|
sun::iptables-restore < /etc/iptables.drop
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
moon::ipsec start
|
||||||
|
sun::ipsec start
|
||||||
|
moon::expect-connection net-net
|
||||||
|
sun::expect-connection net-net
|
||||||
|
moon::ipsec up net-net
|
||||||
@@ -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 winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-m-w-s-b-ip4-in-ip6.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
An IPv6 ESP tunnel connection between the gateways <b>moon</b> and <b>sun</b> is successfully set up.
|
||||||
|
It connects the two subnets hiding behind their respective gateways. The authentication is based on
|
||||||
|
X.509 certificates. Upon the successful establishment of the IPsec tunnel, <b>leftfirewall=yes</b>
|
||||||
|
automatically inserts ip6tables-based firewall rules that let pass the tunneled traffic.
|
||||||
|
In order to test both the net-to-net tunnel and the firewall rules, client <b>alice</b> behind <b>moon</b>
|
||||||
|
sends an IPv6 ICMP request to client <b>bob</b> behind <b>sun</b> using the ping6 command.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*INSTALLED, TUNNEL::YES
|
||||||
|
alice::ping6 -c 1 -p deadbeef ip6-bob.strongswan.org::64 bytes from ip6-bob.strongswan.org: icmp_seq=1::YES
|
||||||
|
sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES
|
||||||
|
sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
*filter
|
||||||
|
|
||||||
|
# default policy is DROP
|
||||||
|
-P INPUT DROP
|
||||||
|
-P OUTPUT DROP
|
||||||
|
-P FORWARD DROP
|
||||||
|
|
||||||
|
# allow ICMPv6 neighbor-solicitations
|
||||||
|
-A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
|
||||||
|
-A OUTPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
|
||||||
|
|
||||||
|
# allow ICMPv6 neighbor-advertisements
|
||||||
|
-A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
|
||||||
|
-A OUTPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
|
||||||
|
|
||||||
|
# log dropped packets
|
||||||
|
-A INPUT -j LOG --log-prefix " IN: "
|
||||||
|
-A OUTPUT -j LOG --log-prefix " OUT: "
|
||||||
|
|
||||||
|
COMMIT
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftsubnet=fec1::0/16
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_SUN
|
||||||
|
rightsubnet=fec2::0/16
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
install_routes = no
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
*filter
|
||||||
|
|
||||||
|
# default policy is DROP
|
||||||
|
-P INPUT DROP
|
||||||
|
-P OUTPUT DROP
|
||||||
|
-P FORWARD DROP
|
||||||
|
|
||||||
|
# allow ICMPv6 neighbor-solicitations
|
||||||
|
-A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
|
||||||
|
-A OUTPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
|
||||||
|
|
||||||
|
# allow ICMPv6 neighbor-advertisements
|
||||||
|
-A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
|
||||||
|
-A OUTPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
|
||||||
|
|
||||||
|
# log dropped packets
|
||||||
|
-A INPUT -j LOG --log-prefix " IN: "
|
||||||
|
-A OUTPUT -j LOG --log-prefix " OUT: "
|
||||||
|
|
||||||
|
COMMIT
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
left=PH_IP_SUN
|
||||||
|
leftsubnet=fec2::0/16
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=fec1::0/16
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# /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
|
||||||
|
install_routes=no
|
||||||
|
fragment_size = 1400
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
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"
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.flush
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
|
sun::iptables-restore < /etc/iptables.rules
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
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::expect-connection net-net
|
||||||
|
sun::expect-connection net-net
|
||||||
|
moon::ipsec up net-net
|
||||||
@@ -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 winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-m-w-s-b-ip6-in-ip4.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
An IPv6 ESP tunnel connection between the gateways <b>moon</b> and <b>sun</b> is successfully set up.
|
||||||
|
It connects the two subnets hiding behind their respective gateways. The authentication is based on
|
||||||
|
X.509 certificates. Upon the successful establishment of the IPsec tunnel, <b>leftfirewall=yes</b>
|
||||||
|
automatically inserts ip6tables-based firewall rules that let pass the tunneled traffic.
|
||||||
|
In order to test both the net-to-net tunnel and the firewall rules, client <b>alice</b> behind <b>moon</b>
|
||||||
|
sends an IPv6 ICMP request to client <b>bob</b> behind <b>sun</b> using the ping6 command.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
moon:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net.net.*INSTALLED, TUNNEL::YES
|
||||||
|
alice::ping6 -c 1 -p deadbeef ip6-bob.strongswan.org::64 bytes from ip6-bob.strongswan.org: icmp_seq=1::YES
|
||||||
|
sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES
|
||||||
|
sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
*filter
|
||||||
|
|
||||||
|
# default policy is DROP
|
||||||
|
-P INPUT DROP
|
||||||
|
-P OUTPUT DROP
|
||||||
|
-P FORWARD DROP
|
||||||
|
|
||||||
|
# allow ICMPv6 neighbor-solicitations
|
||||||
|
-A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
|
||||||
|
-A OUTPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
|
||||||
|
|
||||||
|
# allow ICMPv6 neighbor-advertisements
|
||||||
|
-A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
|
||||||
|
-A OUTPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
|
||||||
|
|
||||||
|
# log dropped packets
|
||||||
|
-A INPUT -j LOG --log-prefix " IN: "
|
||||||
|
-A OUTPUT -j LOG --log-prefix " OUT: "
|
||||||
|
|
||||||
|
COMMIT
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
mobike=no
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftsubnet=fec1::0/16
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_SUN
|
||||||
|
rightsubnet=fec2::0/16
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# /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
|
||||||
|
install_routes = no
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
*filter
|
||||||
|
|
||||||
|
# default policy is DROP
|
||||||
|
-P INPUT DROP
|
||||||
|
-P OUTPUT DROP
|
||||||
|
-P FORWARD DROP
|
||||||
|
|
||||||
|
# allow ICMPv6 neighbor-solicitations
|
||||||
|
-A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
|
||||||
|
-A OUTPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT
|
||||||
|
|
||||||
|
# allow ICMPv6 neighbor-advertisements
|
||||||
|
-A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
|
||||||
|
-A OUTPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT
|
||||||
|
|
||||||
|
# log dropped packets
|
||||||
|
-A INPUT -j LOG --log-prefix " IN: "
|
||||||
|
-A OUTPUT -j LOG --log-prefix " OUT: "
|
||||||
|
|
||||||
|
COMMIT
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
mobike=no
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
left=PH_IP_SUN
|
||||||
|
leftsubnet=fec2::0/16
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=fec1::0/16
|
||||||
|
[email protected]
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# /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
|
||||||
|
install_routes=no
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
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"
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.flush
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
|
sun::iptables-restore < /etc/iptables.rules
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
sun::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
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::expect-connection net-net
|
||||||
|
sun::expect-connection net-net
|
||||||
|
moon::ipsec up net-net
|
||||||
@@ -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 winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-m-w-s-b-ip6-in-ip4.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
The roadwarriors <b>carol</b> and <b>dave</b> set up an IPv6 connection each
|
||||||
|
to gateway <b>moon</b>. The authentication is based on <b>X.509 certificates</b>.
|
||||||
|
Upon the successful establishment of the IPv6 ESP tunnels, <b>leftfirewall=yes</b>
|
||||||
|
automatically inserts ip6tables-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> send
|
||||||
|
an IPv6 ICMP request to the client <b>alice</b> behind the gateway <b>moon</b>
|
||||||
|
using the ping6 command.
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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
|
||||||
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw\[2]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw[{]1}.*INSTALLED, TUNNEL::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw[{]2}.*INSTALLED, TUNNEL::YES
|
||||||
|
carol::ping6 -c 1 ip6-alice.strongswan.org::64 bytes from ip6-alice.strongswan.org: icmp_seq=1::YES
|
||||||
|
dave:: ping6 -c 1 ip6-alice.strongswan.org::64 bytes from ip6-alice.strongswan.org: icmp_seq=1::YES
|
||||||
|
moon::tcpdump::IP6 ip6-carol.strongswan.org > ip6-moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP6 ip6-moon.strongswan.org > ip6-carol.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP6 ip6-dave.strongswan.org > ip6-moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP6 ip6-moon.strongswan.org > ip6-dave.strongswan.org: ESP::YES
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP6_CAROL
|
||||||
|
leftcert=carolCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=fec1::/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = random nonce aes sha1 sha2 md5 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP6_DAVE
|
||||||
|
leftcert=daveCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=fec1::/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
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev1
|
||||||
|
fragmentation=yes
|
||||||
|
|
||||||
|
conn rw
|
||||||
|
left=PH_IP6_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftsubnet=fec1::/16
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%any
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
carol::ipsec stop
|
||||||
|
dave::ipsec stop
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
carol::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
dave::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
alice::"ip route del fec0:\:/16 via fec1:\:1"
|
||||||
|
carol::"ip route del fec1:\:/16 via fec0:\:1"
|
||||||
|
dave::"ip route del fec1:\:/16 via fec0:\:1"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.drop
|
||||||
|
carol::iptables-restore < /etc/iptables.drop
|
||||||
|
dave::iptables-restore < /etc/iptables.drop
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
carol::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
dave::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
alice::"ip route add fec0:\:/16 via fec1:\:1"
|
||||||
|
carol::"ip route add fec1:\:/16 via fec0:\:1"
|
||||||
|
dave::"ip route add fec1:\:/16 via fec0:\:1"
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
dave::ipsec start
|
||||||
|
moon::expect-connection rw
|
||||||
|
carol::expect-connection home
|
||||||
|
dave::expect-connection home
|
||||||
|
carol::ipsec up home
|
||||||
|
dave::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-m-c-w-d-ip6.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="moon"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol dave"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
The roadwarriors <b>carol</b> and <b>dave</b> set up an IPv6 connection each
|
||||||
|
to gateway <b>moon</b>. The authentication is based on <b>X.509 certificates</b>.
|
||||||
|
Upon the successful establishment of the IPv6 ESP tunnels, <b>leftfirewall=yes</b>
|
||||||
|
automatically inserts ip6tables-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> send
|
||||||
|
an IPv6 ICMP request to the client <b>alice</b> behind the gateway <b>moon</b>
|
||||||
|
using the ping6 command.
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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
|
||||||
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw\[2]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw[{]1}.*INSTALLED, TUNNEL::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw[{]2}.*INSTALLED, TUNNEL::YES
|
||||||
|
carol::ping6 -c 1 ip6-alice.strongswan.org::64 bytes from ip6-alice.strongswan.org: icmp_seq=1::YES
|
||||||
|
dave:: ping6 -c 1 ip6-alice.strongswan.org::64 bytes from ip6-alice.strongswan.org: icmp_seq=1::YES
|
||||||
|
moon::tcpdump::IP6 ip6-carol.strongswan.org > ip6-moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP6 ip6-moon.strongswan.org > ip6-carol.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP6 ip6-dave.strongswan.org > ip6-moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP6 ip6-moon.strongswan.org > ip6-dave.strongswan.org: ESP::YES
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP6_CAROL
|
||||||
|
leftcert=carolCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=fec1::/16
|
||||||
|
keyexchange=ikev2
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
hash_and_url = yes
|
||||||
|
load = random nonce aes sha1 sha2 md5 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP6_DAVE
|
||||||
|
leftcert=daveCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP6_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=fec1::/16
|
||||||
|
keyexchange=ikev2
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
hash_and_url = yes
|
||||||
|
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
ca strongswan
|
||||||
|
cacert=strongswanCert.pem
|
||||||
|
certuribase=http://ip6-winnetou.strongswan.org/certs/
|
||||||
|
crluri=http://ip6-winnetou.strongswan.org/strongswan.crl
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
|
||||||
|
conn rw
|
||||||
|
left=PH_IP6_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
[email protected]
|
||||||
|
leftsubnet=fec1::/16
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%any
|
||||||
|
keyexchange=ikev2
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
hash_and_url = yes
|
||||||
|
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
carol::ipsec stop
|
||||||
|
dave::ipsec stop
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
carol::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
dave::ip6tables-restore < /etc/ip6tables.flush
|
||||||
|
alice::"ip route del fec0:\:/16 via fec1:\:1"
|
||||||
|
carol::"ip route del fec1:\:/16 via fec0:\:1"
|
||||||
|
dave::"ip route del fec1:\:/16 via fec0:\:1"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.drop
|
||||||
|
carol::iptables-restore < /etc/iptables.drop
|
||||||
|
dave::iptables-restore < /etc/iptables.drop
|
||||||
|
moon::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
carol::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
dave::ip6tables-restore < /etc/ip6tables.rules
|
||||||
|
alice::"ip route add fec0:\:/16 via fec1:\:1"
|
||||||
|
carol::"ip route add fec1:\:/16 via fec0:\:1"
|
||||||
|
dave::"ip route add fec1:\:/16 via fec0:\:1"
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
dave::ipsec start
|
||||||
|
moon::expect-connection rw
|
||||||
|
carol::expect-connection home
|
||||||
|
dave::expect-connection home
|
||||||
|
carol::ipsec up home
|
||||||
|
dave::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-m-c-w-d-ip6.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="moon"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol dave"
|
||||||
|
|
||||||
|
# IP protocol used by IPsec is IPv6
|
||||||
|
#
|
||||||
|
IPV6=1
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
The roadwarriors <b>carol</b> and <b>dave</b> set up an IPv6-in-IPv4 tunnel connection each
|
||||||
|
to gateway <b>moon</b>. The authentication is based on <b>X.509 certificates</b>.
|
||||||
|
Both <b>carol</b> and <b>dave</b> request a virtual IPv6 address from <b>moon</b> via
|
||||||
|
the IKEv1 mode config payload.
|
||||||
|
<p/>
|
||||||
|
Upon the successful establishment of the ESP tunnels, <b>leftfirewall=yes</b>
|
||||||
|
automatically inserts ip6tables-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> send
|
||||||
|
an IPv6 ICMP request to the client <b>alice</b> behind the gateway <b>moon</b>
|
||||||
|
using the ping6 command.
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
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
|
||||||
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw\[2]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw[{]1}.*INSTALLED, TUNNEL::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw[{]2}.*INSTALLED, TUNNEL::YES
|
||||||
|
carol::ping6 -c 1 ip6-alice.strongswan.org::64 bytes from ip6-alice.strongswan.org: icmp_seq=1::YES
|
||||||
|
dave:: ping6 -c 1 ip6-alice.strongswan.org::64 bytes from ip6-alice.strongswan.org: icmp_seq=1::YES
|
||||||
|
moon::tcpdump::carol.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::moon.strongswan.org > carol.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::dave.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::moon.strongswan.org > dave.strongswan.org: ESP::YES
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user