Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L2tp连接失败-win10 #1026

Closed
6 tasks done
xyyxhcj opened this issue Oct 1, 2021 · 5 comments
Closed
6 tasks done

L2tp连接失败-win10 #1026

xyyxhcj opened this issue Oct 1, 2021 · 5 comments

Comments

@xyyxhcj
Copy link

xyyxhcj commented Oct 1, 2021

任务列表

问题描述
image

重现步骤

  1. 服务器执行 wget https://git.io/vpnsetup -O vpn.sh && sudo sh vpn.sh
  2. win10客户端使用显示的信息连接

期待的正确结果
连接失败

日志
检查日志及 VPN 状态,并添加错误日志以帮助解释该问题(如果适用)。

服务器信息(请填写以下信息)

  • 操作系统: Red Hat Enterprise Linux Server release 7.9 (Maipo)
  • 服务提供商(如果适用): [oracle cloud]

客户端信息(请填写以下信息)

  • 设备: PC
  • 操作系统: Win10
  • VPN 模式: IPsec/L2TP

其它信息
日志:
Oct 1 04:33:47 instance-20210930-1405 pluto[19208]: "l2tp-psk"[3] 39.128.25.0 #3: responding to Main Mode from unknown peer 39.128.25.0:10557
Oct 1 04:33:47 instance-20210930-1405 pluto[19208]: "l2tp-psk"[3] 39.128.25.0 #3: Oakley Transform [AES_CBC (256), HMAC_SHA1, DH20] refused
Oct 1 04:33:47 instance-20210930-1405 pluto[19208]: "l2tp-psk"[3] 39.128.25.0 #3: Oakley Transform [AES_CBC (128), HMAC_SHA1, DH19] refused
Oct 1 04:33:47 instance-20210930-1405 pluto[19208]: "l2tp-psk"[3] 39.128.25.0 #3: sent Main Mode R1
Oct 1 04:33:47 instance-20210930-1405 pluto[19208]: "l2tp-psk"[3] 39.128.25.0 #3: sent Main Mode R2
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[3] 39.128.25.0 #3: Peer ID is ID_IPV4_ADDR: '192.168.1.3'
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[3] 39.128.25.0 #3: switched from "l2tp-psk"[3] 39.128.25.0 to "l2tp-psk"
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[3] 39.128.25.0: deleting connection instance with peer 39.128.25.0 {isakmp=#0/ipsec=#0}
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: Peer ID is ID_IPV4_ADDR: '192.168.1.3'
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: IKE SA established {auth=PRESHARED_KEY cipher=AES_CBC_256 integ=HMAC_SHA1 group=MODP2048}
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: Configured DPD (RFC 3706) support not enabled because remote peer did not advertise DPD support
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: the peer proposed: 193.123.84.118/32:1701 -UDP-> 192.168.1.3/32:1701
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: NAT-Traversal: received 2 NAT-OA. Using first; ignoring others
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: responding to Quick Mode proposal {msgid:00000001}
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: us: 10.0.0.158[193.123.84.118]:17/1701 them: 39.128.25.0[192.168.1.3]:17/1701
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: sent Quick Mode reply, inbound IPsec SA installed, expecting confirmation transport mode {ESPinUDP=>0x368d5188<0x82265e08 xfrm=AES_CBC_128-HMAC_SHA1_96 NATOA=192.168.1.3 NATD=39.128.25.0:10558 DPD=unsupported}
Oct 1 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: IPsec SA established transport mode {ESPinUDP=>0x368d5188 <0x82265e08 xfrm=AES_CBC_128-HMAC_SHA1_96 NATOA=192.168.1.3 NATD=39.128.25.0:10558 DPD=unsupported}
Oct 1 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: received Delete SA(0x368d5188) payload: deleting IPsec State #4
Oct 1 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: deleting state (STATE_QUICK_R2) aged 0.922585s and sending notification
Oct 1 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: ESP traffic information: in=383B out=289B
Oct 1 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: deleting state (STATE_MAIN_R3) aged 1.821123s and sending notification
Oct 1 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0: deleting connection instance with peer 39.128.25.0 {isakmp=#0/ipsec=#0}
Oct 1 04:34:50 instance-20210930-1405 sudo: opc : TTY=pts/0 ; PWD=/home/opc ; USER=root ; COMMAND=/bin/grep pluto /var/log/secure

状态:
sudo service ipsec status
Redirecting to /bin/systemctl status ipsec.service
● ipsec.service - Internet Key Exchange (IKE) Protocol Daemon for IPsec
Loaded: loaded (/usr/lib/systemd/system/ipsec.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2021-10-01 04:31:14 GMT; 9min ago
Docs: man:ipsec(8)
man:pluto(8)
man:ipsec.conf(5)
Process: 18795 ExecStopPost=/usr/local/sbin/ipsec --stopnflog (code=exited, status=0/SUCCESS)
Process: 18790 ExecStopPost=/bin/bash -c if test "$EXIT_STATUS" != "12"; then /sbin/ip xfrm policy flush; /sbin/ip xfrm state flush; fi (code=exited, status=0/SUCCESS)
Process: 18785 ExecStop=/usr/local/libexec/ipsec/whack --shutdown (code=exited, status=0/SUCCESS)
Process: 19196 ExecStartPre=/usr/local/sbin/ipsec --checknflog (code=exited, status=0/SUCCESS)
Process: 19193 ExecStartPre=/usr/local/sbin/ipsec --checknss (code=exited, status=0/SUCCESS)
Process: 18806 ExecStartPre=/usr/local/libexec/ipsec/_stackmanager start (code=exited, status=0/SUCCESS)
Process: 18803 ExecStartPre=/usr/local/libexec/ipsec/addconn --config /etc/ipsec.conf --checkconfig (code=exited, status=0/SUCCESS)
Main PID: 19208 (pluto)
Status: "Startup completed."
CGroup: /system.slice/ipsec.service
└─19208 /usr/local/libexec/ipsec/pluto --leak-detective --config /etc/ipsec.conf --nofork

Oct 01 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: NAT-Traversal: received 2 NAT-OA. Using first; ignoring others
Oct 01 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: responding to Quick Mode proposal {msgid:00000001}
Oct 01 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: us: 10.0.0.158[193.123.84.118]:17/1701 them: 39.128.25.0[192.168.1.3]:17/1701
Oct 01 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: sent Quick Mode reply, inbound IPsec SA installed, expecting confirmation transport mode {ESPinU...unsupported}
Oct 01 04:33:48 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: IPsec SA established transport mode {ESPinUDP=>0x368d5188 <0x82265e08 xfrm=AES_CBC_128-HMAC_SHA1...unsupported}
Oct 01 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: received Delete SA(0x368d5188) payload: deleting IPsec State #4
Oct 01 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: deleting state (STATE_QUICK_R2) aged 0.922585s and sending notification
Oct 01 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #4: ESP traffic information: in=383B out=289B
Oct 01 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0 #3: deleting state (STATE_MAIN_R3) aged 1.821123s and sending notification
Oct 01 04:33:49 instance-20210930-1405 pluto[19208]: "l2tp-psk"[4] 39.128.25.0: deleting connection instance with peer 39.128.25.0 {isakmp=#0/ipsec=#0}
Hint: Some lines were ellipsized, use -l to show in full.

@xyyxhcj
Copy link
Author

xyyxhcj commented Oct 1, 2021

端口已打开
image

@hwdsl2
Copy link
Owner

hwdsl2 commented Oct 4, 2021

@xyyxhcj 你好!你提供的日志显示 Windows 10 客户端在连接后马上自动断开。这说明你在该客户端上没有应用必要的注册表更改 [1],或者在应用注册表更改后没有重启计算机以生效。你再试一下。另外,你也可以使用 IKEv2 模式 [2](推荐)。

[1] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#windows-%E9%94%99%E8%AF%AF-809
[2] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/ikev2-howto-zh.md

@hwdsl2 hwdsl2 closed this as completed Oct 4, 2021
@xyyxhcj
Copy link
Author

xyyxhcj commented Oct 5, 2021

@xyyxhcj 你好!你提供的日志显示 Windows 10 客户端在连接后马上自动断开。这说明你在该客户端上没有应用必要的注册表更改 [1],或者在应用注册表更改后没有重启计算机以生效。你再试一下。另外,你也可以使用 IKEv2 模式 [2](推荐)。

[1] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#windows-%E9%94%99%E8%AF%AF-809 [2] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/ikev2-howto-zh.md

之前是修改了注册表 但是没有重启 ,刚又操作了一遍 也重启了,但是还是同样连接不上

@xyyxhcj xyyxhcj changed the title L2tp连接失败 L2tp连接失败-win10 Oct 5, 2021
@xyyxhcj
Copy link
Author

xyyxhcj commented Oct 5, 2021

@xyyxhcj 你好!你提供的日志显示 Windows 10 客户端在连接后马上自动断开。这说明你在该客户端上没有应用必要的注册表更改 [1],或者在应用注册表更改后没有重启计算机以生效。你再试一下。另外,你也可以使用 IKEv2 模式 [2](推荐)。
[1] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#windows-%E9%94%99%E8%AF%AF-809 [2] https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/ikev2-howto-zh.md

之前是修改了注册表 但是没有重启 ,刚又操作了一遍 也重启了,但是还是同样连接不上

我用iphone也是连接不上

Repository owner deleted a comment from xyyxhcj Oct 5, 2021
@kooyeed
Copy link

kooyeed commented Sep 13, 2022

我的错误一模一样。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants