Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Fluppy
New Contributor

IPsec Tunnel to StrongSwan fails after about 1 hour

I've got an IPsec tunnel to a VM running StrongSwan. When I bring the tunnel up, everything works as expected for about 1 hour, after which the tunnel seems to stop working as it show's as Down on the Fortigate side. If I restart the ipsec tunnel on the strongswan side, it works again for about 1 hour.

I followed this guide to set this up originally https://community.fortinet.com/t5/FortiGate/Technical-Tip-FortiGate-Site-to-Site-VPN-with-Strongswan...

Output of "ipsec statusall"

ipsec status.png

My ipsec.conf

ipsec conf.png

On the fortigate side of things I got the following as my tunnel settings

fg network.png

fg phase 1.png

fg phase 2.png

I've omitted the firewall rules and routes as these are working fine as far as I can tell. 

Any idea what could be causing this and how to fix it? Would appreciate any pointers!

1 Solution
alwis
Staff
Staff

Hi @Fluppy 

 

Seems the phase2 negotiation failed after rekey 3600 expired.

 

Could you please try to turn off your PFS [Phase 2 setting]on fortigate side. Based on screenshot

 

i believe it was not enable on Strong Swan .

 

Regards

Alwis

View solution in original post

4 REPLIES 4
AEK
SuperUser
SuperUser

When you say tunnel down on FG side you mean phase2 down, right?

Anyway, try start the following debug command before the failure in order to see what's happening when it fails. Use the timestamp to locate the related portion of logs.

diagnose debug console timestamp enable 
diagnose debug application ike -1
diagnose debug enable

 

Also share the following output once it fails:

diagnose vpn ike gateway list

 

AEK
AEK
AEK
SuperUser
SuperUser

Since you said it remains about an hour, can you change the key lifetime (phase 2 SA) on both ends from 3600 to something else (like 600) then see the behavior?

AEK
AEK
alwis
Staff
Staff

Hi @Fluppy 

 

Seems the phase2 negotiation failed after rekey 3600 expired.

 

Could you please try to turn off your PFS [Phase 2 setting]on fortigate side. Based on screenshot

 

i believe it was not enable on Strong Swan .

 

Regards

Alwis

Fluppy
New Contributor

Yep, after making this post I went over the log messages and saw that it was keeping the phase 1 up but failing phase 2 at renegotiation. Turning off PFS does indeed "fix" it. 

Strongswan docs say the following "PFS is enabled by appending a DH group to the ESP or AH cipher proposal"

Not sure which DH group I need to add though...

Labels
Top Kudoed Authors