Afterwards I have a script that does this:iptables -t mangle -A OUTPUT -m owner --uid-owner deluge -j MARK --set-mark 0x1
VPN KILLSWITCH
I verify it works with this: curl ipinfo.io if it shows I'm in Denver I'm good#!/bin/bash
OLD_IP=$(cat /etc/VPN_TO_CHECK.txt)
NEW_IP=$(/sbin/ifconfig tun0 | grep 'inet addr:' | cut -d: -f2| cut -d' ' -f1)
#if [[ ! $NEW_IP == $OLD_IP ]]; then
# echo "IP CHANGED"
ip rule flush table deluge
ip rule add from all fwmark 0x1 lookup deluge
ip route add default via $NEW_IP table deluge
#sed -i -e "s/$OLD_IP/$NEW_IP/g" /home/deluge/.config/deluge/core.conf
#chown deluge:deluge /home/deluge/.config/deluge/core.conf
#/etc/init.d/deluged restart
killall deluged
/usr/bin/deluged --pidfile /home/deluge/deluged.pid -L debug -l /home/deluge/deluged.log --user deluge --group deluge --config /home/deluge/.config/deluge -i $NEW_IP
#else
# echo "NO CHANGE YOU ARE PROTECTED"
#fi
echo $NEW_IP > /etc/VPN_TO_CHECK.txt
I have a the following quote of text in my deluged Sysvinit script for deluged
My core.conf for deluge
IP_ADDRESS=$(cat < /etc/VPN_TO_CHECK.txt)
start_daemon ${BIN_FILE} --pidfile /home/deluge/deluged.pid -L debug -l /home/deluge/deluged.log --user deluge --group deluge --config /home/deluge/.config/deluge -i $IP_ADDRESS
My vpn.ovpn has nobind enabled so it can be a split tunnel - if i dont do this my entire network is unable to be contacted outside the networkcore.conf
allowed_remote: true
listen_interface: [equals /etc/VPN_TO_CHECK]
outgoing_interface: "tun0"
For whatever reason when I have my VPN_KILLSWITCH ran I am able to access the webui via my internal network (either at home or wireguard) However outside I am unable to access webui - but I can torrent behind a VPN from PIA
Is there a way to ONLY have torrent traffic use tun0 BUT...have the ability to access the webui via whether I am at home OR outside my network without a wireguard client. I have Iptables setup to deny all traffic to ports 0-1055 internally - the only way to access my http, ssh, etc is thru wireguard. I do have one IP address that is not connected via wireguard the ability to bypass all this (Work PC wont allow wireguard so I allow it a free pass from its static IP)
Is deluge not intended to be used this way? I want to be able to access the webui - at work, no wireguard, no special programs - I am able to access my plex, ssh, apache server all ports between 1-1055 at work because i gave a specific entry to allow it....how can I do this with deluge to where ONLY torrents go thru PIA VPN and the webui is available outside my home LAN? Am I wasting my time on this...is it even possible?
Thanks