Hello, I had my RPI3 with OSMC set up with SickRage, CouchPotato, Transmissiona and a OPENVPN. IT was working perfectly. I then used these instructions to set up a IPTABLES based VPN Kill switch to address challenges I was having with my IP leaking. How To Create A VPN Killswitch Using Iptables on Linux - LinuxConfig.org After that, I could not get Transmission to start again.
To trouble shoot I reset my IPTABLES back to “Allow all” and still could not get Transmission to restart. The last change I made was to turn re-enable IPV6 by commenting out the 4 lines disabling IPV6 in the /etc/sysctl.d/99-sysctl.conf file. Still no luck, I don’t know what to do next but still feel that starting from scratch and rebuilding the OSMC unit is a bit extreme. I’m hoping there is some noob thing I might be missing here.
Here is the log report after the last failed event: $ sudo service transmission start Job for transmission.service failed because a timeout was exceeded. See “systemctl status transmission.service” and “journalctl -xe” for details. osmc@osmc:~$ journalctl -xe Jul 13 19:09:18 osmc sudo: pam_unix(sudo:session): session closed for user root Jul 13 19:09:22 osmc sudo: osmc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/pidof openvpn Jul 13 19:09:22 osmc sudo: pam_unix(sudo:session): session opened for user root by (uid=0) Jul 13 19:09:22 osmc systemd: transmission.service: State ‘stop-final-sigterm’ timed out. Killing. Jul 13 19:09:22 osmc systemd: transmission.service: Killing process 1798 (transmission-da) with signal SIGKILL. Jul 13 19:09:22 osmc mediacenter: 1386 Jul 13 19:09:22 osmc sudo: pam_unix(sudo:session): session closed for user root Jul 13 19:09:22 osmc systemd: transmission.service: Main process exited, code=killed, status=9/KILL Jul 13 19:09:22 osmc systemd: Failed to start Transmission BitTorrent Daemon. – Subject: Unit transmission.service has failed – Defined-By: systemd – Support: Debian -- Support – -- Unit transmission.service has failed.
I can confirm the VPN kill switch from these instructions works:
I would clear all the iptables rules and just look at the section for the vpn kill switch, you will need to change eth0 for the network interface on the pi and also change the the network (192.168.1.0/24) on line 3 to match your lan’s network. So for example these are the rules on my debian vm:
Thank you for the help Tom. I’m still struggling please forgive any noob mistakes that are in here.
First: the VPN kill switch instructions are great, I followed them verbatim and believe I have it working. I did have some trouble in handling spaces in the name of of my US California.conf file but think I worked that out using openvpn@USx20California or etc/openvpn/US\ California.conf).
Here are the outputs of sudo iptables -S
osmc@osmc:~$ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eth0 -o tun0 -j ACCEPT
-A OUTPUT -o tun0 -m comment --comment vpn -j ACCEPT
-A OUTPUT -o eth0 -p icmp -m comment --comment icmp -j ACCEPT
-A OUTPUT -d 192.168.1.0/24 -o eth0 -m comment --comment lan -j ACCEPT
-A OUTPUT -o eth0 -p udp -m udp --dport 1198 -m comment --comment openvpn -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m tcp --sport 22 -m comment --comment ssh -j ACCEPT
-A OUTPUT -o eth0 -p udp -m udp --dport 123 -m comment --comment ntp -j ACCEPT
-A OUTPUT -o eth0 -p udp -m udp --dport 53 -m comment --comment dns -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m tcp --dport 53 -m comment --comment dns -j ACCEPT
-A OUTPUT -o eth0 -j DROP
Then I ran
and my terminal froze…
if I run the the transmission status here is what I get: sudo service transmission status
● transmission.service - Transmission BitTorrent Daemon
Loaded: loaded (/lib/systemd/system/transmission.service; enabled; vendor pre
Active: failed (Result: timeout) since Sun 2018-07-15 22:14:36 PDT; 15min ago
Process: 777 ExecStart=/usr/bin/transmission-daemon -f --log-error --allowed *
Process: 345 ExecStartPre=/bin/sleep 10 (code=exited, status=0/SUCCESS)
Main PID: 777 (code=killed, signal=KILL)
Jul 15 11:00:26 osmc systemd: Starting Transmission BitTorrent Daemon...
Jul 15 22:13:06 osmc systemd: transmission.service: Start operation timed out
Jul 15 22:14:36 osmc systemd: transmission.service: State 'stop-final-sigterm
Jul 15 22:14:36 osmc systemd: transmission.service: Killing process 777 (tran
Jul 15 22:14:36 osmc systemd: transmission.service: Main process exited, code
Jul 15 22:14:36 osmc systemd: Failed to start Transmission BitTorrent Daemon.
Jul 15 22:14:36 osmc systemd: transmission.service: Unit entered failed state
Jul 15 22:14:36 osmc systemd: transmission.service: Failed with result 'timeo
lines 1-15/15 (END)
are there other logs that would help with trouble shooting. pleae remember I’m very new to this, so there could easily be something obvious and simple that I’m missing.
I checked my IPTABLES again using sudo iptables -S
since it has been overnight.
I then ran transmision:
sudo /usr/bin/transmission-daemon -f
[2018-07-16 21:30:26.498] Transmission 2.93 (3c5870d4f5) started (session.c:740)
[2018-07-16 21:30:26.498] RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:971)
[2018-07-16 21:30:26.498] RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:1213)
[2018-07-16 21:30:26.498] RPC Server Whitelist enabled (rpc-server.c:1217)
[2018-07-16 21:30:26.498] Couldn’t bind port 51413 on 0.0.0.0: Address already in use (Is another copy of Transmission already running?) (net.c:380)
[2018-07-16 21:30:26.498] Couldn’t bind port 51413 on ::: Address already in use (Is another copy of Transmission already running?) (net.c:380)
[2018-07-16 21:30:26.498] UDP Couldn’t bind IPv4 socket (tr-udp.c:271)
[2018-07-16 21:30:26.498] UDP Couldn’t rebind IPv6 socket (tr-udp.c:189)
[2018-07-16 21:30:26.498] DHT Generating new id (tr-dht.c:311)
[2018-07-16 21:30:26.499] Using settings from “/root/.config/transmission-daemon” (daemon.c:528)
[2018-07-16 21:30:26.499] Saved “/root/.config/transmission-daemon/settings.json” (variant.c:1266)
[2018-07-16 21:30:26.499] Port Forwarding (NAT-PMP) initnatpmp succeeded (0) (natpmp.c:70)
[2018-07-16 21:30:26.499] Port Forwarding (NAT-PMP) sendpublicaddressrequest succeeded (2) (natpmp.c:70)
[2018-07-16 21:30:34.498] Port Forwarding Starting (port-forwarding.c:92)
[2018-07-16 21:32:19.498] RPC Server Unable to bind to 0.0.0.0:9091 after 10 attempts, giving up (rpc-server.c:846)
[2018-07-16 21:32:34.498] Port Forwarding Starting (port-forwarding.c:92)
Also see quite a lot strange packages dnsmasq (Are you trying to run pihole?) Also gnome packages, theres no x-windows, so I’m not sure what good these will do. As I said before I would back your kodi settings and do a fresh install.
Other than kodi, openvpn and transmission, what else are you trying to run through osmc? If its just SickRage & couch pototo, please search the discourse and you will find instructions on how to set these up osmc.
Who is your vpn provider? I should be able to provide instructions for setting up the vpn, without NetworkMananger.
Moved your topic to help & support, rather than general discussion.
So if i’m reading that correctly I have an eth0 network interface and two active VPN tunnels. I’m wondering if when I reloaded my backed up settings the OSMC, OpenVPN manager I had installed from Zomboided repo reloaded.
Should I just modify the IPTABLE rules to add the TUN1 and TUN0 lines?d
sudo systemctl stop openvpn curl ipinfo.io/ip - you should now be seeing either the public IP from your ISP, or will timeout. wget http://ipv4.download.thinkbroadband.com/20MB.zip - If it downloads the vpn kill switch isn’t working.
This is normal message, unless the vpn is failing at this point you can ignore it.