L2TPv3 Ethernet Tunnel Manager for Ubuntu/Debian
A modular, production-quality CLI tool for managing multiple L2TPv3 tunnels and TCP port forwarding via socat.
__ __ _ _ ___
\ \ / / | | | | |__ \
\ \ / /__ _ __| |_ _____ _| | ) |
\ \/ / _ \| '__| __/ _ \ \/ / | / /
\ / (_) | | | || __/> <| |____/ /_
\/ \___/|_| \__\___/_/\_\______|____|
- π§ Interactive TUI management panel with Rich
- π Multiple L2TPv3 tunnels on a single server
- π TCP port forwarding via socat
- π Systemd integration for persistence
- π¦ One-liner installation
- π‘οΈ Secure configuration with 0600 permissions
- π― Fully configurable tunnel IDs
bash <(curl -Ls https://raw.githubusercontent.com/iliya-Developer/VortexL2/main/install.sh)sudo vortexl2Each tunnel needs:
- Tunnel Name: A unique identifier (e.g.,
server1,kharej-hetzner) - Local IP: This server's public IP
- Remote IP: The other server's public IP
- Interface IP: Tunnel interface IP (e.g.,
10.30.30.1/24) - Tunnel IDs: Unique IDs for the L2TP connection
Both servers need matching tunnel configurations with swapped values:
| Parameter | Server A | Server B |
|---|---|---|
| Local IP | 1.2.3.4 | 5.6.7.8 |
| Remote IP | 5.6.7.8 | 1.2.3.4 |
| Interface IP | 10.30.30.1/24 | 10.30.30.2/24 |
| Tunnel ID | 1000 | 2000 |
| Peer Tunnel ID | 2000 | 1000 |
| Session ID | 10 | 20 |
| Peer Session ID | 20 | 10 |
Select "Start Current Tunnel" from the menu on both servers.
Select "Port Forwards" and add ports like: 443,80,2053
sudo vortexl2
# 1. Install prerequisites (option 1)
# 2. Manage Tunnels (option 2) β Add New Tunnel
# - Name: tunnel1
# 3. Configure Current Tunnel (option 3)
# - Local IP: 1.2.3.4
# - Remote IP: 5.6.7.8
# - Interface IP: 10.30.30.1/30
# - Remote Forward Target: 10.30.30.2
# - Tunnel ID: 1000
# - Peer Tunnel ID: 2000
# - Session ID: 10
# - Peer Session ID: 20
# 4. Start Tunnel (option 4)
# 5. Port Forwards (option 6) β Add portssudo vortexl2
# Same steps but with swapped values:
# - Local IP: 5.6.7.8
# - Remote IP: 1.2.3.4
# - Interface IP: 10.30.30.2/30
# - Tunnel ID: 2000
# - Peer Tunnel ID: 1000
# - Session ID: 20
# - Peer Session ID: 10| Command | Description |
|---|---|
sudo vortexl2 |
Open management panel |
sudo vortexl2 apply |
Apply all tunnels (for systemd boot) |
sudo vortexl2 --version |
Show version |
# Show L2TP tunnels
ip l2tp show tunnel
# Show L2TP sessions
ip l2tp show session
# Check interface (l2tpeth0, l2tpeth1, etc.)
ip addr show l2tpeth0# List listening ports
ss -ltnp | grep socat
# Check service status
systemctl status vortexl2-forward@443# Tunnel service logs
journalctl -u vortexl2-tunnel -f
# Forward service logs
journalctl -u vortexl2-forward@443 -fβ Tunnel not working
- Ensure both sides have matching tunnel IDs (swapped peer values)
- Check firewall allows IP protocol 115 (L2TPv3)
- Verify kernel modules are loaded:
lsmod | grep l2tp
β Port forward not working
- Check socat is installed:
which socat - Verify tunnel is up:
ping 10.30.30.2(from one side) - Check service status:
systemctl status vortexl2-forward@PORT
β Interface l2tpeth0 not found
- Ensure session is created (not just tunnel)
- Check kernel modules:
modprobe l2tp_eth - Recreate tunnel from panel
Tunnels are stored in /etc/vortexl2/tunnels/:
# /etc/vortexl2/tunnels/tunnel1.yaml
name: tunnel1
local_ip: "1.2.3.4"
remote_ip: "5.6.7.8"
interface_ip: "10.30.30.1/30"
remote_forward_ip: "10.30.30.2"
tunnel_id: 1000
peer_tunnel_id: 2000
session_id: 10
peer_session_id: 20
interface_index: 0
forwarded_ports:
- 443
- 80
- 2053 βββββββββββββββββββ
β Server A β
β 1.2.3.4 β
β β
β l2tpeth0 βββββββΌββββ L2TPv3 ββββ Server B (5.6.7.8)
β 10.30.30.1 β
β β
β l2tpeth1 βββββββΌββββ L2TPv3 ββββ Server C (9.10.11.12)
β 10.40.40.1 β
β β
βββββββββββββββββββ
βββββββββββββββββββ
β Server A β
β β
β βββββββββββββ β
Users βββββββββββΊ β β socat β β
(443,80,2053) β β forwards β β
β βββββββ¬ββββββ β
β β β
β βββββββΌββββββ β
β β l2tpeth0 β β
β β10.30.30.1 β β
β βββββββ¬ββββββ β
ββββββββββΌβββββββββ
β
L2TPv3 Tunnel
(encap ip)
β
ββββββββββΌβββββββββ
β βββββββΌββββββ β
β β l2tpeth0 β β
β β10.30.30.2 β β
β βββββββββββββ β
β β
β Server B β
β 5.6.7.8 β
βββββββββββββββββββ
VortexL2/
βββ vortexl2/
β βββ __init__.py # Package info
β βββ main.py # CLI entry point
β βββ config.py # Multi-tunnel configuration
β βββ tunnel.py # L2TPv3 tunnel operations
β βββ forward.py # Port forward management
β βββ ui.py # Rich TUI interface
βββ systemd/
β βββ vortexl2-tunnel.service # Tunnel boot service
β βββ vortexl2-forward@.service # Template for forwards
βββ install.sh # Installation script
βββ README.md # This file
L2TPv3 provides NO encryption!
The tunnel transports raw Ethernet frames over IP without any encryption. This is suitable for:
- β Bypassing network restrictions
- β Creating L2 connectivity
- β NOT secure for sensitive data in transit
For encrypted traffic, consider:
- Adding IPsec on top of L2TPv3
- Using WireGuard as an alternative
- Encrypting application-level traffic (TLS/HTTPS)
# Stop services
sudo systemctl stop vortexl2-tunnel
sudo systemctl disable vortexl2-tunnel
# Remove files
sudo rm -rf /opt/vortexl2
sudo rm /usr/local/bin/vortexl2
sudo rm /etc/systemd/system/vortexl2-*
sudo rm -rf /etc/vortexl2
# Reload systemd
sudo systemctl daemon-reloadMIT License
Telegram: @iliyadevsh