Skip to content

Latest commit

Β 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VortexL2

L2TPv3 Ethernet Tunnel Manager for Ubuntu/Debian

A modular, production-quality CLI tool for managing multiple L2TPv3 tunnels and TCP port forwarding via socat.

 __      __        _            _     ___  
 \ \    / /       | |          | |   |__ \ 
  \ \  / /__  _ __| |_ _____  _| |      ) |
   \ \/ / _ \| '__| __/ _ \ \/ / |     / / 
    \  / (_) | |  | ||  __/>  <| |____/ /_ 
     \/ \___/|_|   \__\___/_/\_\______|____|

✨ Features

  • πŸ”§ 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

πŸ“¦ Quick Install

bash <(curl -Ls https://raw.githubusercontent.com/iliya-Developer/VortexL2/main/install.sh)

πŸš€ First Run

1. Open the Management Panel

sudo vortexl2

2. Create Tunnels (Manage Tunnels β†’ Add New Tunnel)

Each 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

3. Configure Both Sides

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

4. Start Tunnel

Select "Start Current Tunnel" from the menu on both servers.

5. Add Port Forwards

Select "Port Forwards" and add ports like: 443,80,2053

🎯 Usage Examples

Server A Setup

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 ports

Server B Setup

sudo 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

πŸ“‹ Commands

Command Description
sudo vortexl2 Open management panel
sudo vortexl2 apply Apply all tunnels (for systemd boot)
sudo vortexl2 --version Show version

πŸ” Troubleshooting

Check Tunnel Status

# Show L2TP tunnels
ip l2tp show tunnel

# Show L2TP sessions
ip l2tp show session

# Check interface (l2tpeth0, l2tpeth1, etc.)
ip addr show l2tpeth0

Check Port Forwards

# List listening ports
ss -ltnp | grep socat

# Check service status
systemctl status vortexl2-forward@443

View Logs

# Tunnel service logs
journalctl -u vortexl2-tunnel -f

# Forward service logs
journalctl -u vortexl2-forward@443 -f

Common Issues

❌ Tunnel not working

  1. Ensure both sides have matching tunnel IDs (swapped peer values)
  2. Check firewall allows IP protocol 115 (L2TPv3)
  3. Verify kernel modules are loaded: lsmod | grep l2tp

❌ Port forward not working

  1. Check socat is installed: which socat
  2. Verify tunnel is up: ping 10.30.30.2 (from one side)
  3. Check service status: systemctl status vortexl2-forward@PORT

❌ Interface l2tpeth0 not found

  1. Ensure session is created (not just tunnel)
  2. Check kernel modules: modprobe l2tp_eth
  3. Recreate tunnel from panel

πŸ”§ Configuration

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

πŸ—οΈ Architecture

Multiple Tunnels

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   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     β”‚
                    β”‚                 β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Port Forwarding

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   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       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

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

⚠️ Security Notice

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)

πŸ”„ Uninstall

# 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-reload

πŸ“„ License

MIT License

πŸ‘€ Author

Telegram: @iliyadevsh

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages