Hello,
Error 789 with L2TP/IPsec on RRAS almost always points to an IPsec negotiation failure rather than a simple PSK mismatch. Since you’ve already confirmed the pre‑shared key is consistent on both sides, the next place to look is the IPsec service stack and its dependencies. The “IPsec Policy Agent” service (PolicyAgent) must be running, and it depends on the Base Filtering Engine (BFE). If BFE is stopped or misconfigured, PolicyAgent will fail silently and you’ll see intermittent 789 errors. Verify in services.msc that both BFE and PolicyAgent are set to Automatic and are running.
Additionally, check the registry under HKLM\SYSTEM\CurrentControlSet\Services\PolicyAgent and confirm the Start value is set to 2 (Automatic). If it’s set to 4 (Disabled), the service won’t start even if you try manually. Another common cause is NAT‑Traversal issues: if the RRAS server is behind NAT, ensure UDP 500 and UDP 4500 are open and not being filtered. Sporadic failures often indicate that one of these ports is intermittently blocked or subject to inspection by a firewall.
To verify PSK consistency beyond just retyping, you can use the RRAS console: open the VPN server properties, go to Security, and re‑enter the PSK. On the client side, delete and recreate the VPN connection to flush any cached credentials. If you want to confirm IPsec negotiation, enable logging by setting the registry key HKLM\SYSTEM\CurrentControlSet\Services\RasMan\Parameters\Logging to 1, then check %windir%\tracing\rasman.log and %windir%\tracing\ipsec.log. These logs will show whether the PSK was rejected or if the failure occurred earlier in the negotiation.
If after confirming services, registry values, and firewall ports the error persists randomly, it’s worth checking whether the Windows Filtering Platform is applying conflicting IPsec policies. Run netsh ipsec dynamic show all to see active policies. A stale or conflicting policy can cause intermittent drops. Clearing them with netsh ipsec dynamic delete all and restarting PolicyAgent can stabilize the connection.
I hope you've found something useful here. If it helps you get more insight into the issue, it's appreciated to accept the answer. Should you have more questions, feel free to leave a message. Have a nice day!
HL.