![Windows 10 클라이언트가 있는 Strongswan VPN - 연결되지 않음](https://rvso.com/image/760632/Windows%2010%20%ED%81%B4%EB%9D%BC%EC%9D%B4%EC%96%B8%ED%8A%B8%EA%B0%80%20%EC%9E%88%EB%8A%94%20Strongswan%20VPN%20-%20%EC%97%B0%EA%B2%B0%EB%90%98%EC%A7%80%20%EC%95%8A%EC%9D%8C.png)
내장된 VPN 기능을 사용하여 Windows-10 클라이언트와 함께 사용할 Strongswan VPN 서버를 실행하려고 합니다(클라이언트 사용자가 쉽게 사용할 수 있도록 하기 위해).
연결을 시도할 때마다 창에는 사용자/패스가 승인된 다음 '연결 중'이라는 메시지가 표시되고 실패합니다. 서버 로그에 "deleting half open IDE_SA ... after timeout" 오류가 표시됩니다.
로그의 마지막 10줄과 함께 "sudo systemctl status Strongswan.service"의 출력:
strongswan.service - strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf
Loaded: loaded (/lib/systemd/system/strongswan.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-12-04 13:15:05 GMT; 1min 38s ago
Main PID: 1859 (starter)
Tasks: 18 (limit: 4915)
CGroup: /system.slice/strongswan.service
ââ1859 /usr/lib/ipsec/starter --daemon charon --nofork
ââ1873 /usr/lib/ipsec/charon
Dec 04 13:15:34 raspberrypi ipsec[1859]: 09[IKE] authentication of 'CN=vpn.example.com' (myself) with RSA signature successful
Dec 04 13:15:34 raspberrypi ipsec[1859]: 09[IKE] sending end entity cert "CN=vpn.example.com"
Dec 04 13:15:34 raspberrypi ipsec[1859]: 09[ENC] generating IKE_AUTH response 1 [ IDr CERT AUTH EAP/REQ/ID ]
Dec 04 13:15:34 raspberrypi ipsec[1859]: 09[ENC] splitting IKE message (1948 bytes) into 2 fragments
Dec 04 13:15:34 raspberrypi ipsec[1859]: 09[ENC] generating IKE_AUTH response 1 [ EF(1/2) ]
Dec 04 13:15:34 raspberrypi ipsec[1859]: 09[ENC] generating IKE_AUTH response 1 [ EF(2/2) ]
Dec 04 13:15:34 raspberrypi ipsec[1859]: 09[NET] sending packet: from 192.168.2.9[4500] to 109.41.64.240[6977] (1248 bytes)
Dec 04 13:15:34 raspberrypi ipsec[1859]: 09[NET] sending packet: from 192.168.2.9[4500] to 109.41.64.240[6977] (768 bytes)
Dec 04 13:15:34 raspberrypi charon[1873]: 14[IKE] sending keep alive to 109.41.64.240[6977]
Dec 04 13:15:43 raspberrypi charon[1873]: 15[JOB] deleting half open IKE_SA with 109.41.64.240 after timeout
Strongswan 및 Windows에 대한 일부 게시물을 앞뒤로 살펴봐도 결함을 찾을 수 없습니다. systemctl restart가 구성을 다시 구문 분석하지 않은 것 같아서 지금 이 질문을 재작업했나요? 나는 내가 무엇을 바꾸든 계속해서 동일한 결과를 얻었습니다. 멈추고 시작하는 것이 도움이 되는 것 같습니다.
(현재 로컬 네트워크 내에서 이 작업을 시도하고 있으므로 모든 IP는 192.168.* 입니다. VPN 범위는 172.17.0.0/16으로 가정됩니다.
/etc/ipsec.conf는 다음과 같습니다.
# ipsec.conf - strongSwan IPsec configuration file
config setup
strictcrlpolicy=no
uniqueids=never
# Add connections here.
# Sample VPN connections
conn %default
keyexchange=ikev2
ike=aes256-sha1-modp1024!
esp=aes256-sha1!
dpdaction=clear
rekey=no
dpddelay=300s
fragmentation=yes
conn win7
compress=no
type=tunnel
left=%any
# leftid=192.168.2.9
leftcert=server.cert.pem
leftsendcert=always
leftsubnet=0.0.0.0/0
leftsendcert=always
right=%any
rightip=%any
rightauth=eap-mschapv2
rightsourceip=172.17.0.128/25
rightdns=192.168.2.1
rightsendcert=never
# eap_identity=%identity
eap_identity=%any
auto=add
include /var/lib/strongswan/ipsec.conf.inc
Windows 10(홈)에서는 연결 이름 'test', 서버 주소 192.168.2.9, VPN 유형 "자동", 로그인 유형 "사용자 이름 및 비밀번호"를 선택했습니다.
/etc/ipsec.secrets 파일에는 'user'라는 사용자가 있습니다. # 이 파일에는 인증을 위한 공유 비밀 또는 RSA 개인 키가 들어 있습니다.
# RSA private key for this host, authenticating it to any other host
# which knows the public part.
# this file is managed with debconf and will contain the automatically created private key
#include /var/lib/strongswan/ipsec.secrets.inc
: RSA "server.key.pem"
user : EAP "testpassword_preliminary"
다음 명령줄을 사용하여 서버에 인증서를 생성했습니다.
ipsec pki --gen --size 4096 --type rsa --outform pem > ca.key.pem
ipsec pki --self --in ca.key.pem --type rsa --dn "CN=VPN Server CA" --ca --lifetime 3650 --outform pem > ca.cert.pem
ipsec pki --gen --size 4096 --type rsa --outform pem > server.key.pem
ipsec pki --pub --in server.key.pem --type rsa | ipsec pki --issue --lifetime 2750 --cacert ca.cert.pem --cakey ca.key.pem --dn "CN=vpn.example.com" --san="vpn.example.com" --flag serverAuth --flag ikeIntermediate --outform pem > server.cert.pem