Skip to main content
AliE
New Member
May 27, 2024
Question

How to get an IPsec VPN Tunnel with a Debian laptop?

  • May 27, 2024
  • 4 replies
  • 4366 views

Hi all,

We want to use IPsec VPN, and we have some Debian users. We have tried to use the package "strongswan" but we haven't  succeeded to connect it. We want to use verification with ldap to authenticate and accept it.

In our FortiGate we have this configuration:

For the 1st phase: 

phase1_fortigate.png

 


For the 2nd phase:

phase2_fortigate.png

 
In our Debian machine, we have tried this configuration:
In the ipsec.conf:

ipsec.conf.png

 


In the â€ƒIPSec.secrets:

ipsec.secrets.png

 


In the updown.sh: 

updown.sh.png

Here, it's the test of our configuration:

test.png

 




Do you have any idea about it? 
Ali

4 replies

spoojary
Staff
Staff
May 27, 2024
Debbie_FTNT
Staff & Editor
Staff & Editor
May 27, 2024

Hey AliE,

one thing that confuses me a bit is the peertype/peerid setting on FortiGate; with that in place, FortiGate would only accept connections from a client that provides that particular peerid during the tunnel setup, and the snippets from your debian environment do not include anything like that ID, as far as I can see.

Maybe remove that, set peertype 'any', and try again?

Please note that peertype 'any' can cause conflict if you have other VPNs listening on the same interface, in that case, do NOT try this!

 

Cheers,

Debbie

AliE
AliEAuthor
New Member
June 12, 2024

Hi,

Thank you for your response. I have rewrite the file "ipsec.conf" and now it's working! 

conn hq         keyexchange = ikev1         ike = aes256-sha256-modp3072         #esp = aes256-sha256-modp3072          esp = aes256-sha256           aggressive = yes          right = 85.158.*.*         rightsubnet = 10.*.5.0/24         rightauth = psk          left = %defaultroute         leftsourceip=%config         leftauth = psk         leftauth2 = xauth         xauth_identity = test.vpn          auto = add         leftupdown = /usr/lib/ipsec/updown.sh


But now I have another problem...

 

When I'm connected, the different routes don't propagate but in windows with fortclient, I can receive these routes. I have enabled ipv4 split tunnel and create a book of addresses for "accesible networks".

Do you have an idea?

Ali

sw2090
SuperUser
SuperUser
June 12, 2024

afair strongswan/openswan do not support split tunneling in ike v1. You might have to either switch your ipsec to ike v2 or set your routes manually.

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!