Repository navigation
VPN and Kill Switch
Bull can route a VM's traffic through OpenVPN or WireGuard and enforce a kill switch so that nothing leaves the machine outside the tunnel. If the VPN drops, traffic stops — no accidental clear-net leaks during an engagement.
sudo bull vpn <vm-name> <config-file>The VM must be running.
Bull figures out the VPN type from the config:
- It first looks at the extension (
.ovpn,.conf,.wg,.wgconf). - It then inspects the contents: a
[Interface](and[Peer]) section means WireGuard;client/remote/proto/devdirectives mean OpenVPN.
If it cannot decide, it stops with an error rather than guessing.
- The config is copied into the VM's directory on the host and uploaded to
/tmpinside the VM. - Bull installs the right client (
openvpnorwireguard) non-interactively. -
OpenVPN: the config is placed at
/etc/openvpn/client/client.confand started viaopenvpn-client@client(enabled on boot). -
WireGuard: the config is placed at
/etc/wireguard/wg0.conf(chmod 600) and started viawg-quick@wg0(enabled on boot). - The kill switch is applied.
- The inventory marks the VM as
vpn_configured.
The kill switch is a set of iptables rules, persisted across reboots via iptables-persistent:
- Default policies:
INPUT ACCEPT,OUTPUT DROP,FORWARD DROP. - Allow loopback in and out.
- Allow the VPN interface (
tun0for OpenVPN,wg0for WireGuard) in and out. - Allow RFC 1918 LAN ranges (
10/8,172.16/12,192.168/16) so Vagrant SSH and management keep working. - Allow established/related connections.
- Save rules to
/etc/iptables/rules.v4and vianetfilter-persistent.
The generated script is also saved on the host at <vm-dir>/vpn/killswitch.sh for reference.
The net effect: with the tunnel up, traffic flows. If the tunnel drops, the default OUTPUT DROP policy blocks everything except loopback and LAN management, so no traffic escapes over the clear net.
After configuring, connect and check the exit IP:
sudo bull connect <vm-name>
curl ifconfig.me # should be the VPN exit IP, not your real oneBull also ships an internal verification routine that checks for a tun0/wg0 interface, reports the external IP, and shows the active DNS server (a quick DNS-leak sanity check).
- The LAN allow-rules are deliberate: they keep Vagrant's SSH management channel alive. They also mean traffic to private ranges is not forced through the VPN.
- The kill switch protects against the VPN process dying. It is not a substitute for verifying your provider's no-log claims or for application-level leak protection.
- If kill-switch setup fails, Bull leaves the VPN configured and warns you, rather than aborting the whole operation.
Bull · MIT License · Technical hardening only — see the Security Model.
Getting started
Features
Internals
Help