Issue with VPN connection
Issue with VPN connection
Hello everyone, I encountered an issue with our VPN setup. We have servers in different locations and rely on a L2TP/IPsec connection for communication. My colleague set up an IPsec connection, and it works fine. However, the connection drops about once a day, then restarts but fails again. Manually disconnecting and reconnecting fixes it temporarily. Since the connection isn’t essential 24/7, but we need to sync data daily, I’m considering a batch file with rasdial commands. I want to run something like: ping -n 1 1.2.3.4 && rasdial myvpn /disconnect || rasdial myvpn. If the server responds but isn’t online, it should disconnect and reconnect. The current command isn’t working as expected. I plan to schedule it every two hours. Any suggestions or help would be greatly appreciated. Thanks!
Hey there, the issue seems to lie with your operator. It checks if the prior command executed properly, and based on my view, "ping" should return success in bash even if the ping fails. The command likely signals failure when something goes wrong with the program itself. For more details, check this link: https://stackoverflow.com/questions/1266...-condition. Take care!
Monitor ping with 1.2.3.4 and check for "bytes=" in the output. Adjust reconnect timing if needed. Two sites suggest a site-to-site IPSec setup might work better. Updated PowerShell script includes connection checks.
Confirm that the Phase 2 security association timers align at both ends.