Ipsec (strongswan) - connecting my router on Azure

Hello peoplpe, i need help...

I try to connect my router with OpenWRT, version 18.06.1 with StronSWan packet, last version on Azure Cloud...

in my ipsec.conf file, i have this:

"# ipsec.conf - strongSwan IPsec configuration file

basic configuration

config setup
# strictcrlpolicy=yes
# uniqueids = no

Add connections here.

conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
authby=secret
keyexchange=ikev2
mobike=no

conn AZURE
auto=start
type=tunnel
aggressive=no
ike=3des-sha1-modp1024
esp=3des-sha1
mark=42
mark_in=42
mark_out=42
left=179.145.54.173
leftsubnet=192.168.1.0/24
leftid=179.145.54.173
leftauth=psk
leftfirewall=yes

right=191.234.166.212
rightsubnet=10.0.0.0/24
rightid=191.234.166.212
rightauth=psk
rightfirewall=yes"

But, when i try to restart ipsec service, I get errors in various lines, like this:

"Stopping strongSwan IPsec failed: starter is not running
Starting strongSwan 5.6.3 IPsec [starter]...
/etc/ipsec.conf:21: syntax error, unexpected STRING [auto]
invalid config file '/etc/ipsec.conf'
unable to start strongSwan -- fatal errors in config"

Reading the 21 line, i have:

"auto=start"

This conf file was retired fron this example in this site: https://jeffchiu.wordpress.com/2017/06/20/kb-connecting-openwrtlede-router-to-azure-virtual-network-gateway-ikev2/

Honestly, I do not know where I might be going wrong ...
I wish some friends could help me ...
Thank you!

Please use "Preformatted text </>" for logs, scripts, configs and general console output.
grafik

1 Like

I could not find the start as option for auto.
https://openwrt.org/docs/guide-user/services/vpn/ipsec/strongswan/basics
You may consider using UCI to configure the tunnel.