testing: Migrated ha/both-active scenario to vici
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
alice::ipsec status 2> /dev/null::rw\[1].*PASSIVE.*mars.strongswan.org.*[email protected]::YES
|
alice::swanctl --list-sas --ike-id 1 --raw 2> /dev/null::rw.*version=2 state=PASSIVE local-host=192.168.0.5 local-port=4500 local-id=mars.strongswan.org remote-host=192.168.0.100 remote-port=4500 [email protected].*encr-alg=AES_CBC encr-keysize=128 integ-alg=HMAC_SHA2_256_128 prf-alg=PRF_HMAC_SHA2_256 dh-group=CURVE_25519.*child-sas.*net.*reqid=1 state=INSTALLED mode=TUNNEL protocol=ESP.*encr-alg=AES_GCM_16 encr-keysize=128.*local-ts=\[10.1.0.0/16] remote-ts=\[192.168.0.100/32]::YES
|
||||||
alice::ipsec status 2> /dev/null::rw\[2].*ESTABLISHED.*mars.strongswan.org.*[email protected]::YES
|
alice::swanctl --list-sas --ike-id 2 --raw 2> /dev/null::rw.*version=2 state=ESTABLISHED local-host=192.168.0.5 local-port=4500 local-id=mars.strongswan.org remote-host=192.168.0.200 remote-port=4500 [email protected].*encr-alg=AES_CBC encr-keysize=128 integ-alg=HMAC_SHA2_256_128 prf-alg=PRF_HMAC_SHA2_256 dh-group=CURVE_25519.*child-sas.*net.*reqid=2 state=INSTALLED mode=TUNNEL protocol=ESP.*encr-alg=AES_GCM_16 encr-keysize=128.*local-ts=\[10.1.0.0/16] remote-ts=\[192.168.0.200/32]::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[1].*ESTABLISHED.*mars.strongswan.org.*[email protected]::YES
|
moon::swanctl --list-sas --ike-id 1 --raw 2> /dev/null::rw.*version=2 state=ESTABLISHED local-host=192.168.0.5 local-port=4500 local-id=mars.strongswan.org remote-host=192.168.0.100 remote-port=4500 [email protected].*encr-alg=AES_CBC encr-keysize=128 integ-alg=HMAC_SHA2_256_128 prf-alg=PRF_HMAC_SHA2_256 dh-group=CURVE_25519.*child-sas.*net.*reqid=1 state=INSTALLED mode=TUNNEL protocol=ESP.*encr-alg=AES_GCM_16 encr-keysize=128.*local-ts=\[10.1.0.0/16] remote-ts=\[192.168.0.100/32]::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[2].*PASSIVE.*mars.strongswan.org.*[email protected]::YES
|
moon::swanctl --list-sas --ike-id 2 --raw 2> /dev/null::rw.*version=2 state=PASSIVE local-host=192.168.0.5 local-port=4500 local-id=mars.strongswan.org remote-host=192.168.0.200 remote-port=4500 [email protected].*encr-alg=AES_CBC encr-keysize=128 integ-alg=HMAC_SHA2_256_128 prf-alg=PRF_HMAC_SHA2_256 dh-group=CURVE_25519.*child-sas.*net.*reqid=2 state=INSTALLED mode=TUNNEL protocol=ESP.*encr-alg=AES_GCM_16 encr-keysize=128.*local-ts=\[10.1.0.0/16] remote-ts=\[192.168.0.200/32]::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*mars.strongswan.org::YES
|
carol::swanctl --list-sas --raw 2> /dev/null::home.*version=2 state=ESTABLISHED local-host=192.168.0.100 local-port=4500 [email protected] remote-host=192.168.0.5 remote-port=4500 remote-id=mars.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=CURVE_25519.*child-sas.*home.*state=INSTALLED mode=TUNNEL.*ESP.*encr-alg=AES_GCM_16 encr-keysize=128.*local-ts=\[192.168.0.100/32] remote-ts=\[10.1.0.0/16]::YES
|
||||||
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*mars.strongswan.org::YES
|
dave:: swanctl --list-sas --raw 2> /dev/null::home.*version=2 state=ESTABLISHED local-host=192.168.0.200 local-port=4500 [email protected] remote-host=192.168.0.5 remote-port=4500 remote-id=mars.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=CURVE_25519.*child-sas.*home.*state=INSTALLED mode=TUNNEL.*ESP.*encr-alg=AES_GCM_16 encr-keysize=128.*local-ts=\[192.168.0.200/32] remote-ts=\[10.1.0.0/16]::YES
|
||||||
alice::cat /var/log/daemon.log::HA segment 1 activated::YES
|
alice::cat /var/log/daemon.log::HA segment 1 activated::YES
|
||||||
moon:: cat /var/log/daemon.log::HA segment 2 activated::YES
|
moon:: cat /var/log/daemon.log::HA segment 2 activated::YES
|
||||||
alice::cat /var/log/daemon.log::handling HA CHILD_SA::YES
|
alice::cat /var/log/daemon.log::handling HA CHILD_SA::YES
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
|
||||||
|
|
||||||
config setup
|
|
||||||
|
|
||||||
conn %default
|
|
||||||
ikelifetime=60m
|
|
||||||
keylife=20m
|
|
||||||
rekeymargin=3m
|
|
||||||
keyingtries=1
|
|
||||||
|
|
||||||
conn rw
|
|
||||||
left=192.168.0.5
|
|
||||||
leftcert=marsCert.pem
|
|
||||||
[email protected]
|
|
||||||
leftsubnet=10.1.0.0/16
|
|
||||||
leftfirewall=yes
|
|
||||||
right=%any
|
|
||||||
keyexchange=ikev2
|
|
||||||
auto=add
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
|
||||||
|
|
||||||
: RSA marsKey.pem
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# /etc/strongswan.conf - strongSwan configuration file
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
charon {
|
charon-systemd {
|
||||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default ha
|
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac vici kernel-netlink socket-default ha
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
ha {
|
ha {
|
||||||
local = PH_IP_ALICE
|
local = 10.1.0.10
|
||||||
remote = PH_IP_MOON1
|
remote = 10.1.0.1
|
||||||
segment_count = 2
|
segment_count = 2
|
||||||
autobalance = 10
|
autobalance = 10
|
||||||
fifo_interface = yes
|
fifo_interface = yes
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
connections {
|
||||||
|
|
||||||
|
rw {
|
||||||
|
local_addrs = 192.168.0.5
|
||||||
|
|
||||||
|
local {
|
||||||
|
auth = pubkey
|
||||||
|
certs = marsCert.pem
|
||||||
|
id = mars.strongswan.org
|
||||||
|
}
|
||||||
|
remote {
|
||||||
|
auth = pubkey
|
||||||
|
}
|
||||||
|
children {
|
||||||
|
net {
|
||||||
|
local_ts = 10.1.0.0/16
|
||||||
|
|
||||||
|
updown = /usr/local/libexec/ipsec/_updown iptables
|
||||||
|
esp_proposals = aes128gcm128-x25519
|
||||||
|
}
|
||||||
|
}
|
||||||
|
version = 2
|
||||||
|
proposals = aes128-sha256-x25519
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
|
||||||
|
|
||||||
config setup
|
|
||||||
|
|
||||||
conn %default
|
|
||||||
ikelifetime=60m
|
|
||||||
keylife=20m
|
|
||||||
rekeymargin=3m
|
|
||||||
keyingtries=1
|
|
||||||
|
|
||||||
conn home
|
|
||||||
left=PH_IP_CAROL
|
|
||||||
leftcert=carolCert.pem
|
|
||||||
[email protected]
|
|
||||||
leftfirewall=yes
|
|
||||||
right=192.168.0.5
|
|
||||||
[email protected]
|
|
||||||
rightsubnet=10.1.0.0/16
|
|
||||||
keyexchange=ikev2
|
|
||||||
auto=add
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# /etc/strongswan.conf - strongSwan configuration file
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
charon {
|
charon-systemd {
|
||||||
load = random nonce aes sha1 sha2 md5 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
load = random nonce aes sha1 sha2 md5 pem pkcs1 curve25519 gmp x509 curl revocation hmac vici kernel-netlink socket-default updown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
connections {
|
||||||
|
|
||||||
|
home {
|
||||||
|
local_addrs = 192.168.0.100
|
||||||
|
remote_addrs = 192.168.0.5
|
||||||
|
|
||||||
|
local {
|
||||||
|
auth = pubkey
|
||||||
|
certs = carolCert.pem
|
||||||
|
id = [email protected]
|
||||||
|
}
|
||||||
|
remote {
|
||||||
|
auth = pubkey
|
||||||
|
id = mars.strongswan.org
|
||||||
|
}
|
||||||
|
children {
|
||||||
|
home {
|
||||||
|
remote_ts = 10.1.0.0/16
|
||||||
|
|
||||||
|
updown = /usr/local/libexec/ipsec/_updown iptables
|
||||||
|
esp_proposals = aes128gcm128-x25519
|
||||||
|
}
|
||||||
|
}
|
||||||
|
version = 2
|
||||||
|
proposals = aes128-sha256-x25519
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
|
||||||
|
|
||||||
config setup
|
|
||||||
|
|
||||||
conn %default
|
|
||||||
ikelifetime=60m
|
|
||||||
keylife=20m
|
|
||||||
rekeymargin=3m
|
|
||||||
keyingtries=1
|
|
||||||
|
|
||||||
conn home
|
|
||||||
left=PH_IP_DAVE
|
|
||||||
leftcert=daveCert.pem
|
|
||||||
[email protected]
|
|
||||||
leftfirewall=yes
|
|
||||||
right=192.168.0.5
|
|
||||||
[email protected]
|
|
||||||
rightsubnet=10.1.0.0/16
|
|
||||||
keyexchange=ikev2
|
|
||||||
auto=add
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# /etc/strongswan.conf - strongSwan configuration file
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
charon {
|
charon-systemd {
|
||||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac vici kernel-netlink socket-default updown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
connections {
|
||||||
|
|
||||||
|
home {
|
||||||
|
local_addrs = 192.168.0.200
|
||||||
|
remote_addrs = 192.168.0.5
|
||||||
|
|
||||||
|
local {
|
||||||
|
auth = pubkey
|
||||||
|
certs = daveCert.pem
|
||||||
|
id = [email protected]
|
||||||
|
}
|
||||||
|
remote {
|
||||||
|
auth = pubkey
|
||||||
|
id = mars.strongswan.org
|
||||||
|
}
|
||||||
|
children {
|
||||||
|
home {
|
||||||
|
remote_ts = 10.1.0.0/16
|
||||||
|
|
||||||
|
updown = /usr/local/libexec/ipsec/_updown iptables
|
||||||
|
esp_proposals = aes128gcm128-x25519
|
||||||
|
}
|
||||||
|
}
|
||||||
|
version = 2
|
||||||
|
proposals = aes128-sha256-x25519
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
|
||||||
|
|
||||||
config setup
|
|
||||||
|
|
||||||
conn %default
|
|
||||||
ikelifetime=60m
|
|
||||||
keylife=20m
|
|
||||||
rekeymargin=3m
|
|
||||||
keyingtries=1
|
|
||||||
|
|
||||||
conn rw
|
|
||||||
left=192.168.0.5
|
|
||||||
leftcert=marsCert.pem
|
|
||||||
[email protected]
|
|
||||||
leftsubnet=10.1.0.0/16
|
|
||||||
leftfirewall=yes
|
|
||||||
right=%any
|
|
||||||
keyexchange=ikev2
|
|
||||||
auto=add
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
|
||||||
|
|
||||||
: RSA marsKey.pem
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# /etc/strongswan.conf - strongSwan configuration file
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
charon {
|
charon-systemd {
|
||||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default ha
|
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac vici kernel-netlink socket-default ha
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
ha {
|
ha {
|
||||||
local = PH_IP_MOON1
|
local = 10.1.0.1
|
||||||
remote = PH_IP_ALICE
|
remote = 10.1.0.10
|
||||||
segment_count = 2
|
segment_count = 2
|
||||||
autobalance = 10
|
autobalance = 10
|
||||||
fifo_interface = yes
|
fifo_interface = yes
|
||||||
@@ -14,4 +14,3 @@ charon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
connections {
|
||||||
|
|
||||||
|
rw {
|
||||||
|
local_addrs = 192.168.0.5
|
||||||
|
|
||||||
|
local {
|
||||||
|
auth = pubkey
|
||||||
|
certs = marsCert.pem
|
||||||
|
id = mars.strongswan.org
|
||||||
|
}
|
||||||
|
remote {
|
||||||
|
auth = pubkey
|
||||||
|
}
|
||||||
|
children {
|
||||||
|
net {
|
||||||
|
local_ts = 10.1.0.0/16
|
||||||
|
|
||||||
|
updown = /usr/local/libexec/ipsec/_updown iptables
|
||||||
|
esp_proposals = aes128gcm128-x25519
|
||||||
|
}
|
||||||
|
}
|
||||||
|
version = 2
|
||||||
|
proposals = aes128-sha256-x25519
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
carol::ipsec stop
|
carol::systemctl stop strongswan
|
||||||
dave::ipsec stop
|
dave::systemctl stop strongswan
|
||||||
moon::ipsec stop
|
moon::systemctl stop strongswan
|
||||||
alice::ipsec stop
|
alice::systemctl stop strongswan
|
||||||
|
moon::cd /etc/swanctl; rm rsa/marsKey.pem x509/marsCert.pem
|
||||||
|
alice::cd /etc/swanctl; rm rsa/marsKey.pem x509/marsCert.pem
|
||||||
moon::iptables-restore < /etc/iptables.flush
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
alice::iptables-restore < /etc/iptables.flush
|
alice::iptables-restore < /etc/iptables.flush
|
||||||
carol::iptables-restore < /etc/iptables.flush
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ moon::iptables-restore < /etc/iptables.rules
|
|||||||
alice::iptables-restore < /etc/iptables.rules
|
alice::iptables-restore < /etc/iptables.rules
|
||||||
carol::iptables-restore < /etc/iptables.rules
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
dave::iptables-restore < /etc/iptables.rules
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
moon::ipsec start
|
moon::cd /etc/swanctl; rm rsa/moonKey.pem x509/moonCert.pem
|
||||||
alice::ipsec start
|
alice::cd /etc/swanctl; rm rsa/aliceKey.pem x509/aliceCert.pem
|
||||||
|
moon::systemctl start strongswan
|
||||||
|
alice::systemctl start strongswan
|
||||||
alice::sleep 1
|
alice::sleep 1
|
||||||
carol::ipsec start
|
carol::systemctl start strongswan
|
||||||
dave::ipsec start
|
dave::systemctl start strongswan
|
||||||
carol::expect-connection home
|
carol::expect-connection home
|
||||||
dave::expect-connection home
|
dave::expect-connection home
|
||||||
carol::ipsec up home
|
carol::swanctl --initiate --child home
|
||||||
dave::ipsec up home
|
dave::swanctl --initiate --child home
|
||||||
|
|||||||
@@ -19,3 +19,7 @@ TCPDUMPHOSTS="venus carol dave"
|
|||||||
# Used for IPsec logging purposes
|
# Used for IPsec logging purposes
|
||||||
#
|
#
|
||||||
IPSECHOSTS="alice moon carol dave"
|
IPSECHOSTS="alice moon carol dave"
|
||||||
|
|
||||||
|
# charon controlled by swanctl
|
||||||
|
#
|
||||||
|
SWANCTL=1
|
||||||
|
|||||||
Reference in New Issue
Block a user