Skip to content

Instantly share code, notes, and snippets.

@MarcoFanti89
MarcoFanti89 / VPNKillswitch.md
Last active September 2, 2023 09:29
OpenVPN killswitch

How to avoid that in case the connection to the VPN server drops, the connection start routing via your ISP network .

Script assuming the vpn server is running on UDP port 1194

Start the killswitch, /usr/local/sbin/vpn-killswitch-start

#!/bin/bash

#accept packets to/from dhcp server

iptables -t filter -A OUTPUT -p udp --dport 67 -j ACCEPT