I'm running deluge on a pi with a vpn using interface tun0. I have iptables in place to prevent any traffic circumventing the vpn tunnel. Should I still set the interface field in the settings to tun0? Whenever I try to enter something I get the following error:
(for example, here I used tun0 which is what ifconfig tells me the vpn is on)
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/deluge/main.py", line 241, in start_daemon
Daemon(options, args)
File "/usr/lib/python2.7/dist-packages/deluge/core/daemon.py", line 180, in __init__
reactor.run()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1267, in run
self.mainLoop()
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1276, in mainLoop
self.runUntilCurrent()
--- <exception caught here> ---
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 902, in runUntilCurrent
call.func(*call.args, **call.kw)
File "/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py", line 267, in _on_set_listen_interface
self._on_set_random_port("random_port", self.config["random_port"])
File "/usr/lib/python2.7/dist-packages/deluge/core/preferencesmanager.py", line 285, in _on_set_random_port
self.session.listen_on(listen_ports[0], listen_ports[1], str(self.config["listen_interface"]).strip())
exceptions.RuntimeError: Invalid argument
Why do you need the IP of your VPN adapter? Is it not sufficient to restrict the traffic to tun? It is as you said, my default policy is drop with exceptions for tun and local traffic (the XXX.XXX.XXX.0 entry below). These tables are persistent so I don't need to make any changes on reboot. After the VPN goes up I call a script to get a forwarded port from my VPN with which I start deluged. If My VPN goes out intermittently, traffic drops immediately. The two ports I allow are needed for my VPN connection. Did I oversee something? I get a green light when I click "Test Active Port" and I have no problem connecting to peers. I was just curious about what the purpose of the interface field is. So it is to bind deluge traffic to a specific network interface?
dom11990 wrote:
Why do you need the IP of your VPN adapter? Is it not sufficient to restrict the traffic to tun? It is as you said, my default policy is drop with exceptions for tun and local traffic (the XXX.XXX.XXX.0 entry below). These tables are persistent so I don't need to make any changes on reboot. After the VPN goes up I call a script to get a forwarded port from my VPN with which I start deluged. If My VPN goes out intermittently, traffic drops immediately. The two ports I allow are needed for my VPN connection. Did I oversee something? I get a green light when I click "Test Active Port" and I have no problem connecting to peers. I was just curious about what the purpose of the interface field is. So it is to bind deluge traffic to a specific network interface?
As per the error I'm getting... I'm still on 1.3.15, maybe this has something to do with it?
I use the IP and the adapter in my rules because it matches the traffic more accurately. The more accurate the match, the more secure it will be.
I have my iptables default policies set to ACCEPT, but rules to direct unmatched traffic to logging chains: