You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a step-by-step guide to make a nekoray killswitch.
This guide is initially for cachyOS (KDE+systemd) but I think other versions pf linux won't require much changes.
History:
I tried iptables and ufw = no solution there. If I block my wifi - VPN doesn't work, if I don't block wifi - it works even without VPN.
let's make nekoray run without asking for root privileges:
Killswitch Script: (to get names of interfaces type "ifconfig", wlan0 - wifi/lan)
you can put it in some home folder (any).
killswitch.sh:
#!/bin/bash
VPN_IF="nekoray-tun"
WIFI_IF="wlan0"
kill_wifi() {
nmcli dev disconnect "$WIFI_IF" 2>/dev/null
sudo ip link set "$WIFI_IF" down 2>/dev/null
if command -v rfkill >/dev/null; then
rfkill_id=$(rfkill list | awk -v iface="$WIFI_IF" '
BEGIN {id=""}
$0 ~ iface {id=prev}
{prev=$1}
END {gsub(":", "", id); print id}
')
if [ -n "$rfkill_id" ]; then
sudo rfkill block "$rfkill_id"
fi
fi
}
vpn_is_up() {
ip link show "$VPN_IF" 2>/dev/null | grep -q '<.*UP.*>'
}
while true; do
if ! vpn_is_up; then
kill_wifi
fi
sleep 1
done
let's create system services directory:
mkdir -p ~/.config/systemd/user
cd ~/.config/systemd/user/
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here is a step-by-step guide to make a nekoray killswitch.
This guide is initially for cachyOS (KDE+systemd) but I think other versions pf linux won't require much changes.
History:
I tried iptables and ufw = no solution there. If I block my wifi - VPN doesn't work, if I don't block wifi - it works even without VPN.
sudo pacman -S util-linuxyou can put it in some home folder (any).
killswitch.sh:
kate vpn-monitor.service
just run:
replace my services with yours
That's all folks. Comments/improvements are appreciated!
Beta Was this translation helpful? Give feedback.
All reactions