🧠💥 How I Routed My Entire Lab's HTB Traffic Through a Single VPN Box
😤 The Problem
If you’re working in a lab environment and doing serious work with Hack The Box (HTB), chances are you've got automation running scanners, exploit frameworks, recon tools, and maybe even a full orchestration setup.
The catch? HTB traffic only routes through their VPN tunnel. So unless every single box in your lab connects to the VPN (spoiler: bad idea), you’re stuck.
🎯 The Goal
Instead of duct-taping VPN clients on every box, here’s what we want:
Single system connected to HTB VPN
All LAN devices route HTB-bound traffic through that system
Clean iptables rules that don’t wreck your firewall
Scriptable and reversible setup that “just works”
🧠 The Setup
Here’s the architecture:
LAN Interface: Your main interface (e.g.,
ens33
)VPN Interface: Where your HTB VPN is connected (
tun0
)LAN Subnet:
192.168.0.0/24
HTB Subnet:
10.10.0.0/16
We’re going to build a gateway that transparently routes traffic from your LAN to HTB over the VPN.
🛠️ The Script
💥Connect my client
10.10.11.165
is an HTB IP address of the box192.168.0.251
my proxy_box IP addressto delete the ip route
⚡ Real-World Use Case
Now every system on my network even my toaster (I always knew it was destined for great things) can reach any HTB target, without needing its own VPN setup. 🤖🔗💣
💬 Final Thoughts
This isn’t about fancy scripts or over-engineering (I tend to do it a lot but don't we all). It’s about having a reliable, controlled setup that routes HTB traffic through your VPN without reinventing the wheel or smashing your firewall with a sledgehammer. You now have a surgical routing setup. There are no hacks, no weird side effects, and just a clean flow from your lab to HTB.
Last updated