This script requires the following packages to be installed:
openvpn- OpenVPN clientdante- SOCKS5 server (providessockd)socat- Socket relaycurl- For testing connectivityiproute2- Network namespace management (usually pre-installed)iptables- Firewall rules (usually pre-installed)
sudo pacman -S openvpn dante socat curl iproute2 iptablescd /path/to/dev-socks-isolation/linux/Arch
chmod +x connect.sh
./connect.shThe script will prompt you for:
- Namespace name (default: vpnspace)
- Path to your OpenVPN config file (.ovpn)
- Network interface (auto-detected)
- Host IP address (auto-detected)
- SOCKS5 ports configuration
- DNS server (default: 8.8.8.8)
- Whether to launch VSCode automatically
./disconnect.shOn Arch Linux, you can optionally create a systemd service for automatic startup:
sudo nano /etc/systemd/system/vscode-vpn-proxy.serviceAdd:
[Unit]
Description=VSCode VPN SOCKS5 Proxy
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/path/to/dev-socks-isolation/linux/Arch/connect.sh
ExecStop=/path/to/dev-socks-isolation/linux/Arch/disconnect.sh
[Install]
WantedBy=multi-user.targetIf you prefer, you can install some packages from the AUR:
dante-server(alternative todante)
Arch Linux uses iptables by default. If you're using nftables, you may need to adjust the scripts or use iptables-nft compatibility layer.
Solution:
sudo pacman -S danteSolution: Ensure your user can run sudo commands:
sudo usermod -aG wheel $USERSolution: Manually specify your network interface:
ip link show
# Look for your active interface (usually starts with 'en' or 'wl')You can modify the DNS server used in the namespace by providing a different value when prompted, or by editing the script.
You can run multiple isolated VPN connections by using different namespace names for each connection.
For Arch-specific issues, check: