2019-04-26 15:48:28 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
xmllint --noout ./configs/10.0.8.100/ipsec/apple/user1.mobileconfig
|
|
|
|
|
2020-01-25 13:08:55 +00:00
|
|
|
CA_CONSTRAINTS="$(openssl verify -verbose \
|
|
|
|
-CAfile ./configs/10.0.8.100/ipsec/.pki/cacert.pem \
|
|
|
|
./configs/10.0.8.100/ipsec/.pki/certs/google-algo-test-pair.com.crt 2>&1)" || true
|
|
|
|
|
|
|
|
echo "$CA_CONSTRAINTS" | grep "permitted subtree violation" >/dev/null && \
|
|
|
|
echo "Name Constraints test passed" || \
|
|
|
|
(echo "Name Constraints test failed" && exit 1)
|
|
|
|
|
|
|
|
echo "$CA_CONSTRAINTS"
|
|
|
|
|
2019-04-26 15:48:28 +00:00
|
|
|
ansible-playbook deploy_client.yml \
|
|
|
|
-e client_ip=localhost \
|
|
|
|
-e vpn_user=desktop \
|
|
|
|
-e server_ip=10.0.8.100 \
|
|
|
|
-e rightsubnet='172.16.0.1/32'
|
|
|
|
|
|
|
|
ipsec up algovpn-10.0.8.100
|
|
|
|
|
|
|
|
ipsec statusall
|
|
|
|
|
|
|
|
ipsec statusall | grep -w ^algovpn-10.0.8.100 | grep -w ESTABLISHED
|
|
|
|
|
|
|
|
fping -t 900 -c3 -r3 -Dse 10.0.8.100 172.16.0.1
|
|
|
|
|
|
|
|
host google.com 172.16.0.1
|
|
|
|
|
|
|
|
echo "IPsec tests passed"
|
2019-05-17 12:49:29 +00:00
|
|
|
|
|
|
|
ipsec down algovpn-10.0.8.100
|