Fixed systemd issues in strongSwan guide

This commit is contained in:
Sun Knudsen 2020-08-05 20:38:20 -04:00
parent b3f3b18510
commit 3e7151a5ba
No known key found for this signature in database
GPG Key ID: 1FA767862BBD1305

View File

@ -312,6 +312,8 @@ EOF
#### Step 20: add and enable dummy network interface #### Step 20: add and enable dummy network interface
If server is configured to use `/etc/network/interfaces`, run:
```shell ```shell
cp /etc/network/interfaces /etc/network/interfaces.backup cp /etc/network/interfaces /etc/network/interfaces.backup
cat << "EOF" >> /etc/network/interfaces cat << "EOF" >> /etc/network/interfaces
@ -324,6 +326,23 @@ EOF
ifup strongswan0 ifup strongswan0
``` ```
If server is configured to use systemd-networkd, run:
```shell
cat << "EOF" >> /etc/systemd/network/10-strongswan0.netdev
[NetDev]
Name=strongswan0
Kind=dummy
EOF
cat << "EOF" >> /etc/systemd/network/20-strongswan0.network
[Match]
Name=strongswan0
[Network]
Address=10.0.2.1/24
EOF
```
#### Step 21: install dnsmasq #### Step 21: install dnsmasq
```shell ```shell
@ -482,8 +501,15 @@ EOF
```shell ```shell
cd /etc/strongswan.d/charon cd /etc/strongswan.d/charon
sed -i 's/load = yes/load = no/g' ./*.conf sed -i 's/load = yes/load = no/' ./*.conf
sed -i 's/load = no/load = yes/g' ./eap-tls.conf ./aes.conf ./dhcp.conf ./farp.conf ./gcm.conf ./hmac.conf ./kernel-netlink.conf ./nonce.conf ./openssl.conf ./pem.conf ./pgp.conf ./pkcs12.conf ./pkcs7.conf ./pkcs8.conf ./pubkey.conf ./random.conf ./revocation.conf ./sha2.conf ./socket-default.conf ./stroke.conf ./x509.conf sed -i 's/load = no/load = yes/' ./eap-tls.conf ./aes.conf ./dhcp.conf ./farp.conf ./gcm.conf ./hmac.conf ./kernel-netlink.conf ./nonce.conf ./openssl.conf ./pem.conf ./pgp.conf ./pkcs12.conf ./pkcs7.conf ./pkcs8.conf ./pubkey.conf ./random.conf ./revocation.conf ./sha2.conf ./socket-default.conf ./stroke.conf ./x509.conf
```
**Backup and edit `/lib/systemd/system/strongswan.service`**
```shell
cp /lib/systemd/system/strongswan.service /lib/systemd/system/strongswan.service.backup
sed -i 's/After=network-online.target/After=dnsmasq.service/' /lib/systemd/system/strongswan.service
``` ```
#### Step 26: create certificate authority (for security reasons, this is done on Mac rather than on server) #### Step 26: create certificate authority (for security reasons, this is done on Mac rather than on server)