Score:0

Can not connect to ikev2 vpn from Ubuntu 22.04

de flag

I created ikev2 server with strongswan. And trying to connect to it from Ubuntu. When I connect from Android it works, so there is no problem with server, there is problem with client.

What I've done from client side on Ubuntu:
installed strongswan

sudo systemctl start strongswan-starter

installed necessary plugins:

sudo apt install strongswan libcharon-extra-plugins

Coppied CA certificate to path:

sudo cp /tmp/ca-cert.pem /etc/ipsec.d/cacerts

Put credentials to secrets:

sudo nano /etc/ipsec.secrets
username : EAP "password"

Created config file:

sudo nano /etc/ipsec.conf
config setup

conn ikev2-rw
    right=server_IP
    # This should match the `leftid` value on your server's configuration
    rightid=server_IP
    rightsubnet=0.0.0.0/0
    rightauth=pubkey
    leftsourceip=%config
    leftid=username
    leftauth=eap-mschapv2
    eap_identity=%identity
    auto=start

And finnaly started the strongswan:

sudo systemctl start strongswan-starter 

When I check ipsec status, there is no errors:

systemctl status ipsec
strongswan-starter.service - strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf
     Loaded: loaded (/lib/systemd/system/strongswan-starter.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2023-06-03 13:44:37 KIV; 1min 49s ago
   Main PID: 11633 (starter)
      Tasks: 18 (limit: 37659)
     Memory: 7.9M
        CPU: 29ms
     CGroup: /system.slice/strongswan-starter.service
             ├─11633 /usr/lib/ipsec/starter --daemon charon --nofork
             └─11637 /usr/lib/ipsec/charon

But there is no internet on my device.

How can I troubleshoot my VPN connection? What and how to check?

Score:0
de flag

Finally I grasp what happened. First of all I've checked the logs:

sudo cat /var/log/syslog

And there have found the error:

charon: 01[IKE] adding DNS server failed

I found that installing resolvconf handle this error:

sudo apt install resolvconf

It took me several weeks to fix this. May be it will save your time.

Kracozebr avatar
de flag
Yeah, thanks, I know about it, but I have to wait 22 hours after I can do it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.