A hardened Bash-based installer for building and operating a GRE tunnel protected by IPSec (strongSwan).
This project automates setup and lifecycle management for a GRE tunnel running over IPSec. It includes:
- Interactive setup menu
- Input validation for IPs and PSK
- Secure config handling (no
sourceon config) - Pinned and checksum-verified external script downloads (
bbr.sh,tcp.sh) - Dedicated systemd service with direct
socatsupervision - Safer uninstall flow that removes only tunnel-specific IPSec files
- Debian/Ubuntu-like Linux (uses
apt-get) - Root access
- Packages:
curl,socat,strongswan,strongswan-pki
sudo bash tunnel.sh- Configure Tunnel
- Check Remote Connection
- Install
bbr.shandtcp.sh(pinned + SHA256 verified) - Check Tunnel Status
- Remove Tunnel
- Exit
/etc/fou_tunnel_config/etc/ipsec.d/fou-tunnel.conf/etc/ipsec.d/fou-tunnel.secrets/etc/systemd/system/fou-tunnel.service/usr/local/sbin/fou-tunnel-runner.sh
- External helper scripts are downloaded from pinned commit URLs and verified with SHA256.
- IPSec PSK is read in silent mode and stored with restricted permissions.
- Firewall rules are intentionally not modified by this script.
این پروژه یک اسکریپت Bash سختگیرانهتر برای راهاندازی و مدیریت تونل GRE روی IPSec (با strongSwan) است.
امکانات اصلی:
- منوی تعاملی برای نصب و مدیریت
- اعتبارسنجی ورودیها (IP و PSK)
- مدیریت امن کانفیگ (بدون
sourceروی فایل کانفیگ) - دانلود اسکریپتهای کمکی با لینک commit ثابت و بررسی SHA256
- سرویس systemd با مدیریت مستقیم
socat - حذف امن که فقط فایلهای مربوط به همین تونل را پاک میکند
- لینوکس Debian/Ubuntu (به دلیل
apt-get) - دسترسی root
- پکیجها:
curl،socat،strongswan،strongswan-pki
sudo bash tunnel.sh- تنظیم تونل
- بررسی ارتباط IP سمت مقابل
- نصب
bbr.shوtcp.sh(با بررسی صحت فایل) - بررسی وضعیت تونل
- حذف تونل
- خروج
/etc/fou_tunnel_config/etc/ipsec.d/fou-tunnel.conf/etc/ipsec.d/fou-tunnel.secrets/etc/systemd/system/fou-tunnel.service/usr/local/sbin/fou-tunnel-runner.sh
- اسکریپتهای خارجی با URL ثابت (commit-pinned) دانلود و با SHA256 اعتبارسنجی میشوند.
- PSK بهصورت مخفی دریافت و با دسترسی محدود ذخیره میشود.
- این اسکریپت قوانین فایروال را تغییر نمیدهد.