Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Jamon, thanks a lot for great tutorial, I’m not used to Linux environment and this helped to go through all steps.
The only issue is that when I’m trying to connect from Windows I get “Can’t connect to <name>. IKE authentication credentials are unacceptable”. It seems that the client certificate doesn’t contain domain name and thus is not used for the connection.
I looked through Step 3’s instructions multiple times and regenerated certificate several times to make sure I have no mistakes (even reinstalled the server to follow the guide very carefully from the scratch) - but after importing to Windows - still no identification (and unacceptable credentials when connecting).
Do you have any idea what might be wrong?
From the previous tutorial on Ubuntu 18, there was a comment for Windows clients that saved me at the time. Here it is:
When connecting from Windows 10 using the above configuration and setup, you will be unable to connect due to the 4096-bit cert encryption scheme used. Windows only supports 1024-bit max by default. However, we can up that to 2048-bit, as long as you make sure you add this registry value:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Rasman\Parameters
[Type] Key Name: [DWORD 32bit] NegotiateDH2048_AES256
Value: 1
Further, you must recreate you root CA cert and your private key cert with 2048 instead of 4096. Then sign the new private key with the root CA cert. Then you need to delete the old root CA cert your imported into Windows and replace it with the 2048-bit version. Also, if your VPN server is behind a firewall, make sure you forward the ports 500 and 4500 UDP to your server. Make sure IPSec passthrough is enabled too.
However it seems that it’s not working anymore for me since I made a new server following this tutorial on ubuntu 20, but it might help others.
On Step-3, when I write that long line, seperated by backslash to be more visible, it just returns wth “>” identifier and does nothing.
Thanks for the awesome tutorial it really helped me … i just have some questions about some information about the
IKA Policy: Can you please explain what is the Data Integrity algorithm used , Encryption Algorithm , Diffie-Hellman Group , IKE Lifetime and is it in Aggressive Mode or not
IPsec Policy: Also Explain what is SA Negotiation , Data Integrity used , Encryption Algorithm , Perfect Forward Secrecy (PFS) enabled or not , Diffie-Hellman Group (Only if DFS is enabled) and at last the SA Lifetime.
I am trying to connect my server with a third party API and they demeaned me to provide these data … please help !
Hi, i have follow all tutuorial, but it just “connecting”, have you tested on Windows 10 2004?
I ended up by the same error message as antonynudnik. After hours of struggling, I increased charon’s debug level to 4, and than saw that eap-mschapv2 was loaded, but unloaded again due to missing dependencies… After installing libstrongswan-extra-plugins it finally worked, so this should also be added to the guide, libcharon-extauth-plugins alone doesn’t do the job (for antonynudnik it probably worked because he already installed libstrongswan-extra-plugins at an earlier stage in the thread).
I’m wondering how to troubleshoot the “unexpected error” from Mac client. In server syslog there is a message: “charon: 09[ENC] generating IKE_AUTH response 1 [ N(AUTH_FAILED) ]”
username/password is the same as configured in /etc/ipsec.secrets
Nov 21 17:48:30 ip-172-31-62-12 charon: 06[ENC] parsed IKE_AUTH request 1 [ IDi N(INIT_CONTACT) IDr CPRQ(ADDR MASK DHCP DNS ADDR6 DHCP6 DNS6 DOMAIN) N(ESP_TFC_PAD_N) N(NON_FIRST_FRAG) SA TSi TSr N(MOBIKE_SUP) ]
Nov 21 17:48:30 ip-172-31-62-12 charon: 06[IKE] received ESP_TFC_PADDING_NOT_SUPPORTED, not using ESPv3 TFC padding
Nov 21 17:48:30 ip-172-31-62-12 charon: 06[IKE] peer supports MOBIKE
Nov 21 17:48:30 ip-172-31-62-12 charon: 06[ENC] generating IKE_AUTH response 1 [ N(AUTH_FAILED) ]
Thank you for the Tutorial, Jamon. What’s the best way to test the VPN is working. I’ve got green active status on client and server. Status messages show sending and receiving packets. How else can I confirm it’s working? When I run a DNS leak test, it shows my local ISP. I didn’t expect that.
What a wonderful tutorial! I have followed your accurate step-by-step configurations and successfully connected all my devices, iOS, macOS, … to the VPN server but, For certain ISPs, when I try to connect to the VPN server, I am getting “Server did not respond” after about a minute or so! I have tested port 500,4500/udp using nmap with various scenarios and found that for some ISPs, port 500 diagnosed as “OPEN|Filtered” and the connection cannot established. Other working ISPs reflect port 500/udp as “OPEN” using nmap and works like a charm! yes, I have thought about blocked ports from certain ISPs but, I can connect to the other VPN services using that faulty ISPs successfully which means that port 500 is not blocked by that ISPs. In other words, for certain ISPs, MY VPN server (created using exact your tutorial) shows port 500/udp “OPEN|Filtered” and VPN connection not working, while Others’ VPN servers showing port 500/udp “OPEN” and working OK at the same time (and same ISP,device and condition). Is this anything related to the NAT or iptables?!
Excellent tutorial, thanks a lot! I have a question…
I have set up my VPN server to hand out IP addresses in the range 192.168.0.240-192.168.0.254. I can connect with my iPhone, and once the connection is established, I can ping my phone at 192.168.0.240 from other computers in the network.
I have a DNS server (bind) set up which is authoritative for my local network and which accepts dynamic updates. Is it possible to configure the VPN so that clients are registered in DNS as well?