![使用 strongswan 在 Ubuntu 上创建 VPN 客户端失败](https://linux22.com/image/781662/%E4%BD%BF%E7%94%A8%20strongswan%20%E5%9C%A8%20Ubuntu%20%E4%B8%8A%E5%88%9B%E5%BB%BA%20VPN%20%E5%AE%A2%E6%88%B7%E7%AB%AF%E5%A4%B1%E8%B4%A5.png)
我已经在家用路由器上设置了 L2TP VPN 服务器,并且 Windows 10 客户端之间的连接正常工作。现在我想在 Ubuntu 18.04 机器上设置 VPN 客户端。我使用了以下配置(xxxx 是我家用路由器的静态 IP,yyyy 是我 ubuntu 机器的私有 IP):
/etc/ipsec.conf
config setup
virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12
nat_traversal=yes
protostack=netkey
plutoopts="--interface=eth0"
conn L2TP-PSK
authby=secret
pfs=no
auto=add
keyingtries=3
dpddelay=30
dpdtimeout=120
dpdaction=clear
rekey=yes
ikelifetime=8h
keylife=1h
type=transport
left=y.y.y.y
leftprotoport=17/1701
right=x.x.x.x
rightprotoport=17/1701
/etc/ipsec.secrets
y.y.y.y x.x.x.x : PSK "pre_shared_key"
/etc/xl2tpd/xl2tpd.conf
[lac vpn-connection]
lns = x.x.x.x
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd.client
length bit = yes
/etc/ppp/options.l2tpd.client
ipcp-accept-local
ipcp-accept-remote
refuse-eap
require-mschap-v2
noccp
noauth
idle 1800
mtu 1410
mru 1410
defaultroute
usepeerdns
debug
connect-delay 5000
name vpn_username
password password
不幸的是我收到了以下错误:
$ sudo ipsec up L2TP-PSK
initiating IKE_SA L2TP-PSK[5] to x.x.x.x
generating IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) N(FRAG_SUP) N(HASH_ALG) N(REDIR_SUP) ]
sending packet: from y.y.y.y[500] to x.x.x.x[500] (1302 bytes)
received packet: from x.x.x.x[500] to y.y.y.y[500] (36 bytes)
parsed IKE_SA_INIT response 0 [ N(NO_PROP) ]
received NO_PROPOSAL_CHOSEN notify error
establishing connection 'L2TP-PSK' failed
不幸的是我找不到任何其他日志:(
非常感谢!Luca