Created comprehensive VPN setup tooling for Peaceful Spirit L2TP/IPsec connection and enhanced agent documentation framework. VPN Configuration (PST-NW-VPN): - Setup-PST-L2TP-VPN.ps1: Automated L2TP/IPsec setup with split-tunnel and DNS - Connect-PST-VPN.ps1: Connection helper with PPP adapter detection, DNS (192.168.0.2), and route config (192.168.0.0/24) - Connect-PST-VPN-Standalone.ps1: Self-contained connection script for remote deployment - Fix-PST-VPN-Auth.ps1: Authentication troubleshooting for CHAP/MSChapv2 - Diagnose-VPN-Interface.ps1: Comprehensive VPN interface and routing diagnostic - Quick-Test-VPN.ps1: Fast connectivity verification (DNS/router/routes) - Add-PST-VPN-Route-Manual.ps1: Manual route configuration helper - vpn-connect.bat, vpn-disconnect.bat: Simple batch file shortcuts - OpenVPN config files (Windows-compatible, abandoned for L2TP) Key VPN Implementation Details: - L2TP creates PPP adapter with connection name as interface description - UniFi auto-configures DNS (192.168.0.2) but requires manual route to 192.168.0.0/24 - Split-tunnel enabled (only remote traffic through VPN) - All-user connection for pre-login auto-connect via scheduled task - Authentication: CHAP + MSChapv2 for UniFi compatibility Agent Documentation: - AGENT_QUICK_REFERENCE.md: Quick reference for all specialized agents - documentation-squire.md: Documentation and task management specialist agent - Updated all agent markdown files with standardized formatting Project Organization: - Moved conversation logs to dedicated directories (guru-connect-conversation-logs, guru-rmm-conversation-logs) - Cleaned up old session JSONL files from projects/msp-tools/ - Added guru-connect infrastructure (agent, dashboard, proto, scripts, .gitea workflows) - Added guru-rmm server components and deployment configs Technical Notes: - VPN IP pool: 192.168.4.x (client gets 192.168.4.6) - Remote network: 192.168.0.0/24 (router at 192.168.0.10) - PSK: rrClvnmUeXEFo90Ol+z7tfsAZHeSK6w7 - Credentials: pst-admin / 24Hearts$ Files: 15 VPN scripts, 2 agent docs, conversation log reorganization, guru-connect/guru-rmm infrastructure additions Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
122 lines
4.6 KiB
PowerShell
122 lines
4.6 KiB
PowerShell
# PST VPN Installation Script
|
|
# Run this script as Administrator (Right-click > Run as Administrator)
|
|
|
|
Write-Host "Installing PST VPN Configuration..." -ForegroundColor Cyan
|
|
|
|
# Check if running as Administrator
|
|
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
|
|
if (-not $isAdmin) {
|
|
Write-Host "ERROR: This script must be run as Administrator!" -ForegroundColor Red
|
|
Write-Host "Right-click PowerShell and select 'Run as Administrator', then run this script again." -ForegroundColor Yellow
|
|
pause
|
|
exit 1
|
|
}
|
|
|
|
# Define paths
|
|
$sourceDir = "D:\ClaudeTools"
|
|
$destDir = "C:\Program Files\OpenVPN\config"
|
|
|
|
# Check if OpenVPN is installed
|
|
if (-not (Test-Path $destDir)) {
|
|
Write-Host "ERROR: OpenVPN does not appear to be installed!" -ForegroundColor Red
|
|
Write-Host "Expected directory not found: $destDir" -ForegroundColor Yellow
|
|
Write-Host "Please install OpenVPN GUI first from: https://openvpn.net/community-downloads/" -ForegroundColor Yellow
|
|
pause
|
|
exit 1
|
|
}
|
|
|
|
# Copy configuration files
|
|
Write-Host "`nCopying configuration files..." -ForegroundColor Yellow
|
|
|
|
try {
|
|
Copy-Item "$sourceDir\PST-NW-VPN-Windows.ovpn" -Destination $destDir -Force
|
|
Write-Host "[OK] Copied PST-NW-VPN-Windows.ovpn" -ForegroundColor Green
|
|
|
|
Copy-Item "$sourceDir\PST-NW-VPN-auth.txt" -Destination $destDir -Force
|
|
Write-Host "[OK] Copied PST-NW-VPN-auth.txt" -ForegroundColor Green
|
|
}
|
|
catch {
|
|
Write-Host "[ERROR] Failed to copy files: $_" -ForegroundColor Red
|
|
pause
|
|
exit 1
|
|
}
|
|
|
|
# Secure the credentials file
|
|
Write-Host "`nSecuring credentials file..." -ForegroundColor Yellow
|
|
$authFile = "$destDir\PST-NW-VPN-auth.txt"
|
|
|
|
try {
|
|
# Get current ACL
|
|
$acl = Get-Acl $authFile
|
|
|
|
# Disable inheritance and remove inherited permissions
|
|
$acl.SetAccessRuleProtection($true, $false)
|
|
|
|
# Remove all existing rules
|
|
$acl.Access | ForEach-Object { $acl.RemoveAccessRule($_) | Out-Null }
|
|
|
|
# Add SYSTEM - Full Control
|
|
$systemRule = New-Object System.Security.AccessControl.FileSystemAccessRule(
|
|
"SYSTEM", "FullControl", "Allow"
|
|
)
|
|
$acl.AddAccessRule($systemRule)
|
|
|
|
# Add Administrators - Full Control
|
|
$adminRule = New-Object System.Security.AccessControl.FileSystemAccessRule(
|
|
"Administrators", "FullControl", "Allow"
|
|
)
|
|
$acl.AddAccessRule($adminRule)
|
|
|
|
# Apply the ACL
|
|
Set-Acl $authFile $acl
|
|
|
|
Write-Host "[OK] Credentials file secured (SYSTEM and Administrators only)" -ForegroundColor Green
|
|
}
|
|
catch {
|
|
Write-Host "[WARNING] Could not secure credentials file: $_" -ForegroundColor Yellow
|
|
Write-Host "Please manually secure this file via Properties > Security" -ForegroundColor Yellow
|
|
}
|
|
|
|
# Check for OpenVPN service
|
|
Write-Host "`nChecking OpenVPN Interactive Service..." -ForegroundColor Yellow
|
|
|
|
$service = Get-Service -Name "OpenVPNServiceInteractive" -ErrorAction SilentlyContinue
|
|
|
|
if ($service) {
|
|
Write-Host "[OK] OpenVPN Interactive Service found" -ForegroundColor Green
|
|
|
|
if ($service.StartType -ne "Automatic") {
|
|
Write-Host "Setting service to Automatic startup..." -ForegroundColor Yellow
|
|
Set-Service -Name "OpenVPNServiceInteractive" -StartupType Automatic
|
|
Write-Host "[OK] Service set to Automatic" -ForegroundColor Green
|
|
}
|
|
|
|
if ($service.Status -ne "Running") {
|
|
Write-Host "Starting OpenVPN Interactive Service..." -ForegroundColor Yellow
|
|
Start-Service -Name "OpenVPNServiceInteractive"
|
|
Write-Host "[OK] Service started" -ForegroundColor Green
|
|
}
|
|
}
|
|
else {
|
|
Write-Host "[WARNING] OpenVPN Interactive Service not found" -ForegroundColor Yellow
|
|
Write-Host "You may need to reinstall OpenVPN with service components" -ForegroundColor Yellow
|
|
}
|
|
|
|
# Summary
|
|
Write-Host "`n========================================" -ForegroundColor Cyan
|
|
Write-Host "Installation Complete!" -ForegroundColor Green
|
|
Write-Host "========================================" -ForegroundColor Cyan
|
|
Write-Host "`nConfiguration files installed to:" -ForegroundColor White
|
|
Write-Host " $destDir" -ForegroundColor Gray
|
|
Write-Host "`nNext steps:" -ForegroundColor White
|
|
Write-Host " 1. Open OpenVPN GUI (system tray)" -ForegroundColor Gray
|
|
Write-Host " 2. Right-click > Connect to 'PST-NW-VPN-Windows'" -ForegroundColor Gray
|
|
Write-Host " 3. Optionally configure 'Start on Boot' for auto-connect" -ForegroundColor Gray
|
|
Write-Host "`nConnection Details:" -ForegroundColor White
|
|
Write-Host " Server: 64.139.88.249:1194" -ForegroundColor Gray
|
|
Write-Host " Username: pst-admin (auto-login configured)" -ForegroundColor Gray
|
|
Write-Host "`n"
|
|
|
|
pause
|