These are a few tips pointed out from recent escalations on IPSec VPN where the tunnel refuse to come up or it keeps failing intermittently.
Check the logs: The log could show whether the IKE packets are send out by the local firewall or not. Usually you could see following logs:
Start IKE negotiation : this means the firewall is initiating / starting sending IKE packet
Remote party timeout : this means that local firewall sent IKE packet to peer, but the peer does not response. In this situation, you need to check the logs on peer to check the reason.
No specific route for the secondary WAN
If the VPN policy is bound to WAN zone, SonicOS will lookup the route table to identify the outgoing interface for IKE negotiation packets. Usaually, if there's no specific route for the VPN gateway, it will go out via the default route.
We need to check whether the remote VPN gateway could be reachable via the default route.
Wan DDOS protection
The option "Enable DDOS protection on WAN interfaces" may also drop the IKE packet, and we can check the log to confirm it. The solution is to enable the option "Always allow VPN negotiate traffic".
High Frequency IKE negotiation
SonicOS has protection to prevent too fast IKE negotiation, we can check TSR and log to confirm it.
For example in TSR,
This behaviour is intended, and it depends on the threshold value for the maximum negotiation for IKE packets the device can handle. This value can be changed in the diag page.
This can also be changed via CLI (SSH needs to be enabled on the interface)