Update Networking/Sophos/Site-to-Site VPNs/IPSec/Automatic Tunnel Resetting.md

This commit is contained in:
2024-09-12 19:49:06 -06:00
parent 3c61abf9ec
commit 2a4e27673a

View File

@ -68,8 +68,18 @@ You need a place to put the script (and if on Windows, `curl.exe`). Follow the
!!! note "Optional Reporting" !!! note "Optional Reporting"
You may find that you want some extra logging enabled so you can track the script doing its job to ensure its working. You can add the following to the script above to add that functionality. You may find that you want some extra logging enabled so you can track the script doing its job to ensure its working. You can add the following to the script above to add that functionality.
Add the following to the bottom of each server in the `Check-VPN-Tunnel` function, directly below the `Reset-VPN-Tunnel` function.
``` powershell ``` powershell
PLACEHOLDER Add-Content -Path "C:\Scripts\VPN_Tunnel_Checker\Tunnel.log" -Value "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') PLACEHOLDER Connection Down"
```
Lastly, change the very end of the script under where the `Check-IHS-Tunnel` function is being called to look like this if you want to log heartbeats and not just when a VPN tunnel is down. The purpose of this is to show the script is actually running. I recommend only temporarily implementing it during initial deployment.
``` powershell
CD "C:\Scripts"
Check-IHS-Tunnel
Add-Content -Path "C:\Scripts\VPN_Tunnel_Checker\Tunnel.log" -Value "$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') Heartbeat"
``` ```
=== "Linux" === "Linux"