F5F Stay Refreshed Power Users Networks Issue with VPN connection

Issue with VPN connection

Issue with VPN connection

S
SrSniper28
Member
231
12-04-2021, 03:03 PM
#1
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!
S
SrSniper28
12-04-2021, 03:03 PM #1

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!

X
XDDanyXD
Junior Member
40
12-19-2021, 09:38 AM
#2
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!
X
XDDanyXD
12-19-2021, 09:38 AM #2

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!

R
Rain_falls
Junior Member
18
12-19-2021, 08:17 PM
#3
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.
R
Rain_falls
12-19-2021, 08:17 PM #3

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.

N
nanaki1324
Junior Member
17
12-20-2021, 01:16 PM
#4
Confirm that the Phase 2 security association timers align at both ends.
N
nanaki1324
12-20-2021, 01:16 PM #4

Confirm that the Phase 2 security association timers align at both ends.

G
Gabokazu
Posting Freak
814
12-26-2021, 06:09 AM
#5
Sure, here you go!
G
Gabokazu
12-26-2021, 06:09 AM #5

Sure, here you go!