Isolated OpenVPN connection for VSCode & JetBrains IDEs - Keep your host IP while your IDEs use VPN
This project provides scripts to create an isolated network environment where only your IDEs (VSCode, IntelliJ IDEA, PyCharm, WebStorm, DataGrip, etc.) use a VPN connection, while the rest of your system maintains its original IP address.
In countries with internet filtering or restrictive networks:
- Developers need VPN to access IDE extensions, plugins, GitHub, and development resources
- BUT turning on system-wide VPN prevents:
- Colleagues from accessing your local development servers
- Testing applications on local network
- Accessing local network resources
- Using your real IP for legitimate purposes
This project creates an isolated network namespace (on Linux) or equivalent isolation (macOS/Windows) that:
- ✅ Routes only IDE traffic through VPN (VSCode, JetBrains IDEs)
- ✅ Keeps your host IP unchanged for all other applications
- ✅ Allows local network access for colleagues and testing
- ✅ Provides true traffic isolation
- VSCode - Visual Studio Code
- IntelliJ IDEA - Ultimate & Community
- PyCharm - Professional & Community
- WebStorm - JavaScript & TypeScript IDE
- DataGrip - Database IDE
- PhpStorm - PHP IDE
- GoLand - Go IDE
- CLion - C/C++ IDE
- Rider - .NET IDE
- RubyMine - Ruby IDE
- AppCode - iOS/macOS IDE
- Android Studio - Built on IntelliJ platform
|
🐧 Linux Arch • Ubuntu • Fedora cd linux/<your-distro>
chmod +x connect.sh
./connect.sh |
🍎 macOS cd mac
chmod +x connect.sh
./connect.sh
|
🪟 Windows cd windows
.\connect.ps1Requires WSL2 |
┌─────────────────────────────────────────────────┐
│ Your Computer │
├─────────────────────────────────────────────────┤
│ │
│ 🌐 Host Network (Real IP: 192.168.1.100) │
│ ├─ Browser: Uses real IP ✓ │
│ ├─ Other apps: Use real IP ✓ │
│ └─ Local servers: Accessible to team ✓ │
│ │
│ ╔═══════════════════════════════════════╗ │
│ ║ 🔒 VPN Namespace (Isolated) ║ │
│ ║ ├─ OpenVPN: VPN IP (5.6.7.8) ║ │
│ ║ ├─ SOCKS5 Proxy ║ │
│ ║ └─ VSCode: Uses VPN IP ✓ ║ │
│ ╚═══════════════════════════════════════╝ │
│ │
└─────────────────────────────────────────────────┘
Uses WSL2 to provide the same Linux namespace isolation, with port forwarding to Windows.
Limited isolation using routing and SOCKS proxy (no native namespace support).
- ✨ Interactive Setup - No manual configuration editing required
- 🎨 Multi-IDE Support - Works with VSCode and all JetBrains IDEs
- 🔍 Auto-Detection - Automatically detects network interface and IP
- 📦 Dependency Management - Offers to install missing packages
- 🎨 Colored Output - Clear, beautiful terminal interface
- 💾 Configuration Saving - Saves setup for easy disconnect
- 🧪 Built-in Testing - Verifies proxy functionality including JetBrains plugins
- 🔄 Easy Disconnect - Clean teardown of all resources
- 📚 Comprehensive Docs - Platform-specific guides for each OS and IDE
- QUICKSTART.md - Fast setup guide for all platforms
- USAGE_GUIDE.md - How to configure VSCode, JetBrains IDEs, browsers, and more
- JETBRAINS_GUIDE.md - 📘 Comprehensive JetBrains IDEs configuration guide
- TESTING.md - Comprehensive testing procedures
- CHANGELOG.md - Version history and changes
-
Linux Distributions:
-
Other Platforms:
- SECURITY.md - Security best practices and hardening
- CONTRIBUTING.md - How to contribute
- PROJECT_SUMMARY.md - Technical architecture overview
- OpenVPN configuration file (.ovpn) - See Preparing Your OpenVPN Config below
- Root/Administrator privileges
openvpn- VPN clientdante-server(ordante) - SOCKS5 serversocat- Socket relaycurl- HTTP clientiproute2- Network namespacesiptables- Firewall rules
- Homebrew package manager
- Same packages as Linux (installed via brew)
- Windows 10 version 2004+ or Windows 11
- WSL2 (Windows Subsystem for Linux 2)
- Ubuntu or another Linux distribution in WSL2
Before running the scripts, you need an OpenVPN configuration file (.ovpn).
- VPN Provider: Download from your VPN service (NordVPN, ProtonVPN, ExpressVPN, etc.)
- Corporate VPN: Request from your IT department
- Self-hosted: Export from your OpenVPN server
1. Save your .ovpn file in an accessible location:
# Create a VPN directory
mkdir -p ~/vpn
# Move your downloaded config there
mv ~/Downloads/your-vpn.ovpn ~/vpn/config.ovpn
# Secure the file
chmod 600 ~/vpn/config.ovpn2. When the script asks for the path, provide the FULL absolute path:
Enter full path to your OpenVPN config file: /home/yourusername/vpn/config.ovpn
Important:
- Use absolute paths (e.g.,
/home/user/vpn/config.ovpn) - Don't use
~(may not expand with sudo) - Common locations:
/etc/openvpn/,~/vpn/,~/Documents/vpn/
3. (Optional) Add credentials for automatic login:
If your VPN requires username/password:
# Create credentials file
cat > ~/vpn/credentials.txt <<EOF
your_username
your_password
EOF
# Secure it
chmod 600 ~/vpn/credentials.txt
# Add to your .ovpn file
echo "auth-user-pass /home/yourusername/vpn/credentials.txt" >> ~/vpn/config.ovpn4. Test your config before using the script:
# Test connection
sudo openvpn --config ~/vpn/config.ovpn
# If it connects successfully, press Ctrl+C
# You're now ready to use it with this script!$ cd linux/Ubuntu
$ ./connect.sh
╔══════════════════════════════════════════════════════════╗
║ VSCode SOCKS5 VPN Namespace Setup ║
║ Isolated OpenVPN connection for VSCode ║
╚══════════════════════════════════════════════════════════╝
✓ All dependencies found
Configuration Setup
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Enter namespace name [vpnspace]:
Enter full path to your OpenVPN config file: /home/user/vpn/config.ovpn
Enter your main network interface [eth0]:
Enter your host IP address [192.168.1.100]:
Enter SOCKS5 port inside namespace [1080]:
Enter local proxy port (exposed to host) [1081]:
Enter DNS server for namespace [8.8.8.8]:
Launch VSCode with proxy after setup? (y/n) [y]:
✓ VPN connected successfully! Assigned IP: 10.8.0.2
✓ Proxy working inside namespace! Public IP: 5.6.7.8
✓ Proxy successfully accessible from host!
╔══════════════════════════════════════════════════════════╗
║ Setup Completed Successfully! ║
╚══════════════════════════════════════════════════════════╝
Proxy address: socks5://10.200.200.2:1081
VPN public IP: 5.6.7.8
✓ VSCode launchedOnce connected, you can configure various applications to use the proxy:
VSCode:
code --proxy-server="socks5://10.200.200.2:1081"JetBrains IDEs (IntelliJ, PyCharm, WebStorm, etc.):
- Go to:
Settings→Appearance & Behavior→System Settings→HTTP Proxy - Select:
Manual proxy configuration→SOCKS - Host:
10.200.200.2, Port:1081
Git:
git config --global http.proxy socks5://10.200.200.2:1081cURL:
curl --socks5-hostname 10.200.200.2:1081 https://api.github.com📖 For complete configuration guides, see USAGE_GUIDE.md
This guide includes detailed instructions for:
- Visual Studio Code (4 methods)
- All JetBrains IDEs (IntelliJ, PyCharm, WebStorm, etc.)
- Web Browsers (Firefox, Chrome, Brave)
- Git (HTTPS and SSH)
- Docker
- Terminal applications (curl, wget, ssh)
- And many more...
$ ./disconnect.sh
✓ Processes terminated
✓ Namespace removed
✓ Virtual interfaces removed
✓ iptables rules removed
✓ Temporary files cleaned
✓ All resources successfully cleaned
System is now clean. You can safely re-run the connect script anytime.Solution: Run with sudo or ensure your user is in the correct group:
# Linux
sudo usermod -aG wheel $USER # Arch/Fedora
sudo usermod -aG sudo $USER # Ubuntu/DebianSolution: Package name varies by distribution:
- Ubuntu/Debian:
dante-server - Arch/Manjaro:
dante - Fedora/RHEL:
dante-server(requires EPEL)
Solution: Check OpenVPN logs:
cat /tmp/openvpn_<namespace>.logSolution: Try different DNS servers when prompted (1.1.1.1, 9.9.9.9)
See the README.md file in each platform directory for detailed troubleshooting.
Contributions are welcome! Please feel free to submit a Pull Request.
- Support for additional Linux distributions
- Improved error handling
- Additional features
- Documentation improvements
- Bug fixes
This project is licensed under the MIT License - see the LICENSE file for details.
- Original concept developed for developers in countries with internet filtering
- Inspired by the need for isolated VPN connections during development
- Built with love for the open-source community
- Access VSCode extensions marketplace through VPN
- Access GitHub and development resources
- Keep local IP for team collaboration
- Test local applications without VPN interference
- Separate development (VSCode) traffic from pentesting traffic
- Different VPN connections for different activities
- Maintain multiple isolated connections
- Route sensitive development traffic through VPN
- Keep regular browsing on normal connection
- Separate work and personal traffic
- Run multiple VPN connections simultaneously
- Each in its own isolated namespace
- No conflicts between connections
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- ✅ Arch Linux
- ✅ Manjaro
- ✅ Ubuntu (20.04, 22.04, 24.04)
- ✅ Linux Mint
- ✅ Pop!_OS
- ✅ Zorin OS
- ✅ Fedora (37+)
- ✅ RHEL (8, 9)
- ✅ CentOS Stream
- ✅ Rocky Linux
- ✅ AlmaLinux
- ✅ openSUSE Leap
- ✅ openSUSE Tumbleweed
- ✅ Kali Linux
- ✅ Parrot Security OS
⚠️ macOS Big Sur (11.x) and newer
- ✅ Windows 10 (version 2004+)
- ✅ Windows 11
This tool is designed for legitimate development purposes. Always ensure:
- You have the right to use VPN services in your location
- Your VPN provider allows this type of connection
- You're complying with your organization's network policies
- Your OpenVPN credentials are stored securely
Made with ❤️ for developers facing internet restrictions