hwdsl2 / setup-ipsec-vpn

Scripts to build your own IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
Other
24.91k stars 6.28k forks source link

Wrong Static IP IKEv2 #1583

Closed carlos-gomez-espinosa closed 1 month ago

carlos-gomez-espinosa commented 1 month ago

Checklist

I read the README I read the Important notes I followed instructions to configure VPN clients I checked IKEv1 troubleshooting, IKEv2 troubleshooting and VPN status I searched existing Issues This bug is about the VPN setup scripts, and not IPsec VPN itself Describe the issue I've done a refresh install. Everything works ok, but the problem is when I assign static ips. It always assign 192.168.43.10

To Reproduce I've edited this file: /etc/ipsec.d/ikev2.conf with this config:

conn client1 rightid=@vpnclient rightaddresspool=192.168.43.4-192.168.43.4 also=ikev2-cp

conn client2WIN rightid="CN=vpnclient, O=IKEv2 VPN" rightaddresspool=192.168.43.5-192.168.43.5 also=ikev2-cp

and restarted with service ipsec restart

When I check the connection with sudo ipsec trafficstatus, I always see 192.168.43.10

Expected behavior It shoud be 192.168.43.4 or 5 if i connect it from windows.

Server (please complete the following information)

OS: Raspberry PI OS **Client

Device: Laptop OS: Windows 11 VPN mode: IKEv2

hwdsl2 commented 1 month ago

@carlos-gomez-espinosa Hello! Static IPs for IKEv2 mode currently do not work when using Libreswan 5.0. This is a known issue previously reported in #1568, I plan to look into it when I have time. In the meantime, you can temporarily switch to use Libreswan 4.15 for this use case. Refer to the "I want to install the older Libreswan version 4" section under Installation in the project README.