steps by command for how to configure ubuntu strongswan for vpn

I want guid to configure strongswan vpn server on ubuntu cloud server and prepare it for client using ikev2 by certificate for ios or mac osx to cconect.

note: I need just the steps, I found many online steps but not work

sampel of my request which is nit working for me

After strongSwan is installed, generate self-signed server keys (using either the openssl or ipsec command).

Then you may need to copy the keys to the corresponding directory and edit the /etc/[login to view URL] files to make your server available for the client to connect to it.

After the server is configured correctly, you need to configure your client to connect to it. You can choose either Windows, MacOS, iOS or Android as the client machine. You do not need to try all of them. You only need to use one of them to connect to the server.

The following are some hints on how to configure your server and use Android to connect to it. All client machines such as Windows, MacOS, iOS, and Android have been tested. Thus there should be no technical issues.

1. The /etc/[login to view URL] file:

[root@etpgl7e etc]# more [login to view URL] config setup


conn %default reauth=no

ikelifetime=2h keylife=2h rekeymargin=10m keyingtries=1 keyexchange=ikev2 dpdaction=restart dpddelay=15s dpdtimeout=5s

conn android left=%any

leftsubnet=[login to view URL] leftcert=[login to view URL] leftauth=pubkey right=%any rightauth=pubkey rightsourceip=[login to view URL] eap_identity=%any

auto=add dpdaction=restart dpddelay=15s dpdtimeout=5s

2. Secret file:

[root@etpgl7e etc]# more [login to view URL]

# /etc/[login to view URL] - strongSwan IPsec secrets file : ECDSA [login to view URL]

3. Generate the self-signed CA keys: openssl req -x509 -days 1460 -newkey rsa:1024 - keyout [login to view URL] -out [login to view URL]

4. Copy [login to view URL] to /etc/ipsec.d/cacerts/[login to view URL] and keep private key secure.

5. Generate a private key for strongswan server: openssl genrsa -des3 -out [login to view URL] 1024

6. Generate a private key for Android phone (remote client): openssl genrsa -des3 -out [login to view URL] 1024

7. To generate certificates, first copy the default openssl configuration file at /usr/lib/ssl/[login to view URL] [login to view URL] to the home directory and modify the related paths there. Then create a file “[login to view URL]” and a file “serial” with empty content and run ‘touch [login to view URL]| echo 01> serial’. This step is only necessary for the first time to create a certificate.

8. Create a certificate request file: openssl req -new -key [login to view URL] -out [login to view URL]

9. Run: openssl ca -config [login to view URL] -days 1001 -out [login to view URL] -infiles [login to view URL]

10. Convert/package the pem version to p12 version: openssl pkcs12 -export -out [login to view URL] -in [login to view URL] -certfile [login to view URL] -inkey [login to view URL]

11. Copy [login to view URL] to the Android phone and it should now connect to the strongSwan server.

Skills: Linux, Mac OS, Network Administration, Ubuntu

See more: ubuntu pptp vpn connection failed, ubuntu pptp vpn connect chap, ubuntu setup vpn server, strongswan client ubuntu, strongswan ubuntu, ubuntu ikev2 client, how to setup ikev2 vpn server, ikev2 vpn server ubuntu, ubuntu site to site vpn, strongswan tutorial, unable to locate package strongswan-plugin-eap-mschapv2, linux, vpn, ubuntu 804 vpn server, ubuntu lts vpn, ubuntu configure network manager vpn pptp, configure ubuntu linux vpn server, ubuntu create vpn server, configure anyconnect ssl vpn router, ubuntu lts vpn server

About the Employer:
( 15 reviews ) Doha, Qatar

Project ID: #17425549

Awarded to:


Connect two servers with site-to-site IPSec VPN Relevant Skills and Experience Linux, IPSec, Networking Proposed Milestones $111 USD - Complete s2s VPN Additional Services Offered $40 USD - Review Linux box access a More

$111 USD in 1 day
(8 Reviews)

4 freelancers are bidding on average $109 for this job

$40 USD in 10 days
(117 Reviews)
$61 USD in 1 day
(22 Reviews)
$222 USD in 3 days
(3 Reviews)