1
0
mirror of synced 2025-03-03 11:23:15 +03:00

Improve workaround

- Specify "left=" in ipsec.conf for servers with 'src' in default route
- Ref: https://github.com/libreswan/libreswan/issues/177
This commit is contained in:
hwdsl2 2018-05-21 00:58:24 -05:00
parent 3b7039ef78
commit e3fe8b05bf
2 changed files with 6 additions and 2 deletions

View File

@ -281,8 +281,7 @@ conn xauth-psk
also=shared
EOF
# Workaround for Raspberry Pi
if uname -m | grep -qi '^arm'; then
if ip -4 route list 0/0 2>/dev/null | grep -qs ' src '; then
PRIVATE_IP=$(ip -4 route get 1 | awk '{print $NF;exit}')
check_ip "$PRIVATE_IP" && sed -i "s/left=%defaultroute/left=$PRIVATE_IP/" /etc/ipsec.conf
fi

View File

@ -262,6 +262,11 @@ conn xauth-psk
also=shared
EOF
if ip -4 route list 0/0 2>/dev/null | grep -qs ' src '; then
PRIVATE_IP=$(ip -4 route get 1 | awk '{print $NF;exit}')
check_ip "$PRIVATE_IP" && sed -i "s/left=%defaultroute/left=$PRIVATE_IP/" /etc/ipsec.conf
fi
# Specify IPsec PSK
conf_bk "/etc/ipsec.secrets"
cat > /etc/ipsec.secrets <<EOF