Skip to content

Instantly share code, notes, and snippets.

@gtors
Created May 19, 2019 20:20
Show Gist options
  • Save gtors/91a4779c521337d4d24eb743865af9a2 to your computer and use it in GitHub Desktop.
Save gtors/91a4779c521337d4d24eb743865af9a2 to your computer and use it in GitHub Desktop.
linux strongswan client l2tp ipsec psk to windows server behind nat
config setup
conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
ike=3des-sha1-modp1024!
esp=3des-sha1!
conn vpn_psk
keyexchange=ikev1
left=%defaultroute
auto=add
authby=psk
type=transport
leftprotoport=17/1701
rightprotoport=17/1701
right=xxx.xxx.xxx.xxx # Public IP or FQDN of the VPN server
rightid=xxx.xxx.xxx.xxx # Local IP (if server behind NAT)
rightsendcert=never
: PSK "your pre-shared key"
ipcp-accept-local
ipcp-accept-remote
refuse-chap
refuse-eap
refuse-pap
require-mschap-v2
noauth
idle 1800
mtu 1410
mru 1410
nodefaultroute
debug
connect-delay 5000
name "username"
password "password"
systemctl start strongswan xl2tpd
ipsec up vpn_psk
echo 'c vpn_psk' > /var/run/xl2tpd/l2tp-control
[global]
access control = yes
debug tunnel = yes
[lac vpn_psk]
lns = xxx.xxx.xxx.xxx # Public IP or FQDN of the VPN server
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd.client
length bit = yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment