mirror of
https://github.com/strongswan/strongswan.git
synced 2025-12-04 00:00:21 -05:00
testing: Add a forecast test case
This commit is contained in:
parent
3748fc70a7
commit
c10b2be967
8
testing/tests/ikev2/forecast/description.txt
Normal file
8
testing/tests/ikev2/forecast/description.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
The roadwarriors <b>carol</b> and <b>dave</b> set up a connection each to
|
||||||
|
gateway <b>moon</b> and request a <b>virtual IP</b>. <b>moon</b> negotiates
|
||||||
|
broadcast and multicast traffic selectors with the clients, and uses
|
||||||
|
<i>%unique</i> marks to avoid any policy conflicts. The enabled <i>forecast</i>
|
||||||
|
plugin on <b>moon</b> installs the required Netfilter rules to make use of these
|
||||||
|
policies, and additionally starts forwarding broadcast and multicast packets
|
||||||
|
between the clients.<br/>
|
||||||
|
To test forwarding, the hosts send multicast and broadcast ping messages.
|
||||||
20
testing/tests/ikev2/forecast/evaltest.dat
Normal file
20
testing/tests/ikev2/forecast/evaltest.dat
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*carol@strongswan.org.*moon.strongswan.org::YES
|
||||||
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*dave@strongswan.org.*moon.strongswan.org::YES
|
||||||
|
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw.*ESTABLISHED.*moon.strongswan.org.*carol@strongswan.org::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw.*ESTABLISHED.*moon.strongswan.org.*dave@strongswan.org::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw.*INSTALLED, TUNNEL, reqid 1::YES
|
||||||
|
moon:: ipsec status 2> /dev/null::rw.*INSTALLED, TUNNEL, reqid 2::YES
|
||||||
|
alice::ping -W 1 -c 1 239.0.0.1 2>&1> /dev/null
|
||||||
|
carol::ping -W 1 -c 1 239.0.0.2 2>&1> /dev/null
|
||||||
|
dave::ping -W 1 -c 1 239.0.0.3 2>&1> /dev/null
|
||||||
|
carol::ping -W 1 -c 1 -b 10.1.255.255 2>&1> /dev/null
|
||||||
|
dave::ping -W 1 -c 1 -b 10.1.255.255 2>&1> /dev/null
|
||||||
|
moon::iptables -t mangle -L -n -v
|
||||||
|
carol::tcpdump::IP alice.strongswan.org > 239.0.0.1: ICMP echo request::YES
|
||||||
|
dave::tcpdump::IP alice.strongswan.org > 239.0.0.1: ICMP echo request::YES
|
||||||
|
carol::tcpdump::IP 10.1.0.130 > 239.0.0.3: ICMP echo request::YES
|
||||||
|
dave::tcpdump::IP 10.1.0.129 > 239.0.0.2: ICMP echo request::YES
|
||||||
|
carol::tcpdump::IP 10.1.0.130 > 10.1.255.255: ICMP echo request::YES
|
||||||
|
dave::tcpdump::IP 10.1.0.129 > 10.1.255.255: ICMP echo request::YES
|
||||||
21
testing/tests/ikev2/forecast/hosts/carol/etc/ipsec.conf
Normal file
21
testing/tests/ikev2/forecast/hosts/carol/etc/ipsec.conf
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_CAROL
|
||||||
|
leftsourceip=%config
|
||||||
|
leftsubnet=0.0.0.0/0
|
||||||
|
leftcert=carolCert.pem
|
||||||
|
leftid=carol@strongswan.org
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=0.0.0.0/0
|
||||||
|
rightid=@moon.strongswan.org
|
||||||
|
auto=add
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default updown resolve
|
||||||
|
}
|
||||||
21
testing/tests/ikev2/forecast/hosts/dave/etc/ipsec.conf
Normal file
21
testing/tests/ikev2/forecast/hosts/dave/etc/ipsec.conf
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=PH_IP_DAVE
|
||||||
|
leftsourceip=%config
|
||||||
|
leftsubnet=0.0.0.0/0
|
||||||
|
leftcert=daveCert.pem
|
||||||
|
leftid=dave@strongswan.org
|
||||||
|
right=PH_IP_MOON
|
||||||
|
rightsubnet=0.0.0.0/0
|
||||||
|
rightid=@moon.strongswan.org
|
||||||
|
auto=add
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default updown resolve
|
||||||
|
}
|
||||||
22
testing/tests/ikev2/forecast/hosts/moon/etc/ipsec.conf
Normal file
22
testing/tests/ikev2/forecast/hosts/moon/etc/ipsec.conf
Normal file
@ -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
|
||||||
|
|
||||||
|
conn rw
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
leftid=@moon.strongswan.org
|
||||||
|
leftsubnet=10.1.0.0/16,224.0.0.0/4
|
||||||
|
right=%any
|
||||||
|
rightid=*@strongswan.org
|
||||||
|
rightsourceip=10.1.0.128/26
|
||||||
|
rightsubnet=%dynamic,224.0.0.0/4,10.1.255.255
|
||||||
|
mark=%unique
|
||||||
|
auto=add
|
||||||
16
testing/tests/ikev2/forecast/hosts/moon/etc/strongswan.conf
Normal file
16
testing/tests/ikev2/forecast/hosts/moon/etc/strongswan.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default updown attr forecast
|
||||||
|
syslog {
|
||||||
|
daemon {
|
||||||
|
net = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugins {
|
||||||
|
forecast {
|
||||||
|
interface = eth1
|
||||||
|
reinject = rw
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
6
testing/tests/ikev2/forecast/posttest.dat
Normal file
6
testing/tests/ikev2/forecast/posttest.dat
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
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
|
||||||
7
testing/tests/ikev2/forecast/pretest.dat
Normal file
7
testing/tests/ikev2/forecast/pretest.dat
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
carol::ipsec start
|
||||||
|
dave::ipsec start
|
||||||
|
moon::ipsec start
|
||||||
|
carol::sleep 2
|
||||||
|
carol::ipsec up home
|
||||||
|
dave::ipsec up home
|
||||||
|
carol::sleep 1
|
||||||
21
testing/tests/ikev2/forecast/test.conf
Normal file
21
testing/tests/ikev2/forecast/test.conf
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/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.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="moon carol dave"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol dave"
|
||||||
Loading…
x
Reference in New Issue
Block a user