Wondering if anyone can help me here. I'm trying to set up a killswitch for my OpenVPN connection to PIA on my Raspberry Pi, but having troubles with it. Have been following the guide on
https://linuxconfig.org/how-to-create-a-vpn-killswitch-using-iptables-on-linux and have the following set up as my rules:
[oconf=]*filter
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT DROP
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o -lo -j ACCEPT
-A OUTPUT -o tun0 -p icmp -j ACCEPT
-A OUTPUT -d 192.168.1.0/24 -j ACCEPT
-A OUTPUT -d 209.222.18.222 -j ACCEPT
-A OUTPUT -d 209.222.18.218 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 1198 -j ACCEPT
-A OUTPUT -o tun0 -j ACCEPT
COMMIT[/oconf]
But when I apply these rules, all my connections (except those already open) close and won't open. I can't run ping commands, can't access websites or servers, I lose local network access etc. Changing "-P OUTPUT DROP" to "-P OUTPUT ACCEPT" brings it back. Also, "-P INPUT DROP" loses me LAN network access, despite my LAN being on the 192.168.1.0 network with /24 subnet mask.
DNS servers are correctly matching what's in resolv.conf and also PIA servers, and my port number is correct. I've also checked using "curl ifconfig.me" that my VPN is active on the Pi. I'm new to playing around with OpenVPN, iptables and rules as you can probably tell, but would appreciate any thoughts you might have on getting this killswitch working right.