testing: Added swanctl/net2net-multicast scenario

This commit is contained in:
Andreas Steffen 2016-09-27 11:45:00 +02:00
parent d7e0ce2878
commit a9562a3f58
9 changed files with 166 additions and 0 deletions

View File

@ -0,0 +1,7 @@
A connection between the subnets behind the gateways <b>moon</b> and <b>sun</b> is set up.
Using the <b>forecast</b> plugin additionally all 224.0.0.251 mDNS multicasts are going
to be tunneled.
The authentication is based on <b>X.509 certificates</b>. Upon the successful
establishment of the IPsec tunnel, mDNS multicasts sent by <b>alice</b> are
received by <b>bob</b> and vice versa whereas unfortunately multicasts originating
from the gateways <b>moon</b> and <b>sun</b> themselves are not tunneled.

View File

@ -0,0 +1,14 @@
alice::traceroute -p 5353 -w 1 -q 1 -m 1 224.0.0.251::traceroute::YES
bob:: traceroute -p 5353 -w 1 -q 1 -m 1 224.0.0.251::traceroute::YES
moon:: traceroute -p 5353 -w 1 -q 1 -m 1 224.0.0.251::traceroute::YES
sun:: traceroute -p 5353 -w 1 -q 1 -m 1 224.0.0.251::traceroute::YES
moon::swanctl --list-sas --raw 2> /dev/null::gw-gw.*version=2 state=ESTABLISHED local-host=192.168.0.1 local-port=500 local-id=moon.strongswan.org remote-host=192.168.0.2 remote-port=500 remote-id=sun.strongswan.org initiator=yes.*encr-alg=AES_CBC encr-keysize=128 integ-alg=HMAC_SHA2_256_128 prf-alg=PRF_HMAC_SHA2_256 dh-group=MODP_3072.*child-sas.*net-net.*state=INSTALLED mode=TUNNEL.*ESP.*encr-alg=AES_GCM_16 encr-keysize=128.*local-ts=\[10.1.0.0/16 224.0.0.251/32] remote-ts=\[10.2.0.0/16 224.0.0.251/32]::YES
sun:: swanctl --list-sas --raw 2> /dev/null::gw-gw.*version=2 state=ESTABLISHED local-host=192.168.0.2 local-port=500 local-id=sun.strongswan.org remote-host=192.168.0.1 remote-port=500 remote-id=moon.strongswan.org.*encr-alg=AES_CBC encr-keysize=128 integ-alg=HMAC_SHA2_256_128 prf-alg=PRF_HMAC_SHA2_256 dh-group=MODP_3072.*child-sas.*net-net.*state=INSTALLED mode=TUNNEL.*ESP.*encr-alg=AES_GCM_16 encr-keysize=128.*local-ts=\[10.2.0.0/16 224.0.0.251/32] remote-ts=\[10.1.0.0/16 224.0.0.251/32]::YES
sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES
sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES
alice::tcpdump::IP bob.strongswan.org.*224.0.0.251::YES
alice::tcpdump::IP moon1.strongswan.org.*224.0.0.251::YES
alice::tcpdump::IP sun1.strongswan.org.*224.0.0.251::NO
bob::tcpdump::IP alice.strongswan.org.*224.0.0.251::YES
bob::tcpdump::IP sun1.strongswan.org.*224.0.0.251::YES
bob::tcpdump::IP moon1.strongswan.org.*224.0.0.251::NO

View File

@ -0,0 +1,22 @@
# /etc/strongswan.conf - strongSwan configuration file
swanctl {
load = pem pkcs1 x509 revocation constraints pubkey openssl random
}
charon {
load = random nonce aes sha1 sha2 pem pkcs1 gmp x509 curl revocation hmac kernel-netlink socket-default forecast vici
start-scripts {
creds = /usr/local/sbin/swanctl --load-creds
conns = /usr/local/sbin/swanctl --load-conns
}
multiple_authentication = no
plugins {
forecast {
groups = 224.0.0.251
interface = eth1
}
}
}

View File

@ -0,0 +1,35 @@
connections {
gw-gw {
local_addrs = 192.168.0.1
remote_addrs = 192.168.0.2
local {
auth = pubkey
certs = moonCert.pem
id = moon.strongswan.org
}
remote {
auth = pubkey
id = sun.strongswan.org
}
children {
net-net {
local_ts = 10.1.0.0/16,224.0.0.251/32
remote_ts = 10.2.0.0/16,224.0.0.251/32
mark_in = %unique
mark_out = %unique
updown = /usr/local/libexec/ipsec/_updown iptables
rekey_time = 5400
rekey_bytes = 500000000
rekey_packets = 1000000
esp_proposals = aes128gcm128-modp3072
}
}
version = 2
mobike = no
reauth_time = 10800
proposals = aes128-sha256-modp3072
}
}

View File

@ -0,0 +1,18 @@
# /etc/strongswan.conf - strongSwan configuration file
charon {
load = random nonce aes sha1 sha2 pem pkcs1 gmp x509 curl revocation hmac kernel-netlink socket-default forecast vici
start-scripts {
creds = /usr/local/sbin/swanctl --load-creds
conns = /usr/local/sbin/swanctl --load-conns
}
multiple_authentication = no
plugins {
forecast {
groups = 224.0.0.251
interface = eth1
}
}
}

View File

@ -0,0 +1,35 @@
connections {
gw-gw {
local_addrs = 192.168.0.2
remote_addrs = 192.168.0.1
local {
auth = pubkey
certs = sunCert.pem
id = sun.strongswan.org
}
remote {
auth = pubkey
id = moon.strongswan.org
}
children {
net-net {
local_ts = 10.2.0.0/16,224.0.0.251/32
remote_ts = 10.1.0.0/16,224.0.0.251/32
mark_in = %unique
mark_out = %unique
updown = /usr/local/libexec/ipsec/_updown iptables
rekey_time = 5400
rekey_bytes = 500000000
rekey_packets = 1000000
esp_proposals = aes128gcm128-modp3072
}
}
version = 2
mobike = no
reauth_time = 10800
proposals = aes128-sha256-modp3072
}
}

View File

@ -0,0 +1,3 @@
moon::swanctl --terminate --ike gw-gw 2> /dev/null
moon::service charon stop 2> /dev/null
sun::service charon stop 2> /dev/null

View File

@ -0,0 +1,7 @@
moon::echo 1 > /proc/sys/net/ipv4/igmp_max_memberships
sun::echo 1 > /proc/sys/net/ipv4/igmp_max_memberships
moon::service charon start 2> /dev/null
sun::service charon start 2> /dev/null
moon::expect-connection gw-gw
sun::expect-connection gw-gw
moon::swanctl --initiate --child net-net 2> /dev/null

View File

@ -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.png"
# Guest instances on which tcpdump is to be started
#
TCPDUMPHOSTS="alice sun bob"
# Guest instances on which IPsec is started
# Used for IPsec logging purposes
#
IPSECHOSTS="moon sun"
# charon controlled by swanctl
#
SWANCTL=1