Running it on a router - proper config?

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
moeburn
Posts: 10
Joined: Sat Aug 31, 2013 4:48 am

Running it on a router - proper config?

Post by moeburn »

I'm trying to run Transmission on my WNDR3700v2 router running Gargoyle (OpenWRT). It works, sort of, but it has confused the hell out of Gargoyle. When Transmission is running, Gargoyle has two entries under "View bandwidth by IP address" for "192.168.1.1". Also, QoS works by filtering traffic source from/destined to 192.168.1.1, for the first couple of minutes, then suddenly lets the traffic through at full speed, because QoS thinks the traffic isn't going to 192.168.1.1, its actually going to 192.168.1.1 (the other one :? )

So I've asked the folks over at Gargoyle, obviously, but I figured I should ask you folks too. I'll post my /root/.config/transmission-daemon/settings.json, and my /etc/config/transmission config file. I've been editing both at the same time, because I have no idea which one Transmission is actually using.

/root/.config/transmission-daemon/settings.json

Code: Select all

{
    "alt-speed-down": 250, 
    "alt-speed-enabled": false, 
    "alt-speed-time-begin": 540, 
    "alt-speed-time-day": 127, 
    "alt-speed-time-enabled": false, 
    "alt-speed-time-end": 1020, 
    "alt-speed-up": 50, 
    "bind-address-ipv4": "0.0.0.0", 
	"bind-address-ipv4": "192.168.1.1", 
    "bind-address-ipv6": "::", 
    "blocklist-enabled": false, 
    "blocklist-url": "http://www.example.com/blocklist", 
    "cache-size-mb": 2, 
    "dht-enabled": true, 
    "download-dir": "/tmp/usb_mount/6c0dc0bd-dacd-4ac8-870a-c060c8b59bb0/RouterTorrents", 
    "download-queue-enabled": true, 
    "download-queue-size": 1, 
    "encryption": 1, 
    "idle-seeding-limit": 30, 
    "idle-seeding-limit-enabled": false, 
    "incomplete-dir": "/root/Downloads", 
    "incomplete-dir-enabled": false, 
    "lpd-enabled": false, 
    "message-level": 2, 
    "peer-congestion-algorithm": "", 
    "peer-limit-global": 240, 
    "peer-limit-per-torrent": 60, 
    "peer-port": 51813, 
    "peer-port-random-high": 65535, 
    "peer-port-random-low": 49152, 
    "peer-port-random-on-start": false, 
    "peer-socket-tos": "default", 
    "pex-enabled": true, 
    "port-forwarding-enabled": true, 
    "preallocation": 1, 
    "prefetch-enabled": 0, 
    "queue-stalled-enabled": false, 
    "queue-stalled-minutes": 30, 
    "ratio-limit": 2, 
    "ratio-limit-enabled": false, 
    "rename-partial-files": true, 
    "rpc-authentication-required": true, 
    "rpc-bind-address": "0.0.0.0", 
    "rpc-enabled": true, 
    "rpc-password": "*******", 
    "rpc-port": 9091, 
    "rpc-url": "/transmission/", 
    "rpc-username": "******", 
    "rpc-whitelist": "127.0.0.1", 
    "rpc-whitelist-enabled": false, 
    "scrape-paused-torrents-enabled": true, 
    "script-torrent-done-enabled": false, 
    "script-torrent-done-filename": "", 
    "seed-queue-enabled": true, 
    "seed-queue-size": 45, 
    "speed-limit-down": 100, 
    "speed-limit-down-enabled": false, 
    "speed-limit-up": 100, 
    "speed-limit-up-enabled": false, 
    "start-added-torrents": true, 
    "trash-original-torrent-files": false, 
    "umask": 18, 
    "upload-slots-per-torrent": 14, 
    "utp-enabled": true
}
/etc/config/transmission

Code: Select all

config transmission
	option enabled 1
	option config_dir '/root/.config/transmission-daemon'
	#option user 'nobody'
	option alt_speed_down 250
	option alt_speed_enabled false
	option alt_speed_time_begin  540
	option alt_speed_time_day 127
	option alt_speed_time_enabled false
	option alt_speed_time_end 1020
	option alt_speed_up 50
	option bind_address_ipv4 '0.0.0.0'
	option bind-address-ipv4 '192.168.1.1'
	option bind_address_ipv6 '::'
	option blocklist_enabled false
	option blocklist_url ''
	option cache_size_mb 2
	option dht_enabled true
	option download_dir '/tmp/usb_mount/6c0dc0bd-dacd-4ac8-870a-c060c8b59bb0/RouterTorrents'
	option download_queue_enabled true
	option download_queue_size 1
	option encryption 1
	option idle_seeding_limit 30
	option idle_seeding_limit_enabled false
	option incomplete_dir '/tmp/transmission/incomplete'
	option incomplete_dir_enabled false
	option lazy_bitfield_enabled true
	option lpd_enabled false
	option message_level 1
	option peer_congestion_algorithm ''
	option peer_limit_global 240
	option peer_limit_per_torrent 60
	option peer_port 51813
	option peer_port_random_high 65535
	option peer_port_random_low 49152
	option peer_port_random_on_start false
	option peer_socket_tos 'default'
	option pex_enabled true
	option port_forwarding_enabled true
	option preallocation 1
	option prefetch_enabled false
	option queue_stalled_enabled false
	option queue_stalled_minutes 30
	option ratio_limit 2.0000
	option ratio_limit_enabled false
	option rename_partial_files true
	option rpc_authentication_required true
	option rpc_bind_address '0.0.0.0'
	option rpc_enabled true
	option rpc_password '*******'
	option rpc_port 9091
	option rpc_url '/transmission/'
	option rpc_username '*******'
	option rpc_whitelist '127.0.0.1,192.168.1.*'
	option rpc_whitelist_enabled false
	option scrape_paused_torrents_enabled true
	option script_torrent_done_enabled false
	option script_torrent_done_filename ''
	option seed_queue_enabled true
	option seed_queue_size 45
	option speed_limit_down 100
	option speed_limit_down_enabled false
	option speed_limit_up 20
	option speed_limit_up_enabled false
	option start_added_torrents true
	option trash_original_torrent_files false
	option umask 18
	option upload_slots_per_torrent 14
	option utp_enabled true
	option scrape_paused_torrents true
	option watch_dir_enabled false
	option watch_dir ''
I have been doing some reading, and I have a feeling it might have something to do with either "utp_enabled = true" or "peer_socket_tos 'default'", so I will try setting utp to false, and peer_socket_tos to 'lowcost', and see if that helps. But if you guys notice any other glaring issues in my config file, or if there are specific changes to it that anyone trying to run Transmission on a router should make, please let me know! Thanks!
Last edited by moeburn on Wed Sep 04, 2013 11:36 pm, edited 1 time in total.
moeburn
Posts: 10
Joined: Sat Aug 31, 2013 4:48 am

Re: Running it on a router - proper config?

Post by moeburn »

edit: nope, removing "bind-address-ipv4": "192.168.1.1" didn't fix the double entry for 192.168.1.1 in Gargoyle's bandwidth monitor...
moeburn
Posts: 10
Joined: Sat Aug 31, 2013 4:48 am

Re: Running it on a router - proper config?

Post by moeburn »

x190 wrote:
moeburn wrote:edit: nope, removing "bind-address-ipv4": "192.168.1.1" didn't fix the double entry for 192.168.1.1 in Gargoyle's bandwidth monitor...
I don't think you should be using both of the following for sure.

option bind_address_ipv4 '0.0.0.0'
option bind-address-ipv4 '192.168.1.1'

If your maintainer wants/needs option bind-address-ipv4 '192.168.1.1', then you could try removing option bind_address_ipv4 '0.0.0.0'.

Since it's unclear which settings are getting loaded you probably should edit both (you may not have done this for 192.168.1.1?) .

Stop the daemon before editing settings.

https://trac.transmissionbt.com/wiki/EditConfigFiles

Note: You should remove your username and password from the forum post settings file.
Whups! That was dumb. Thanks for pointing that out, I masked them with *** now :oops:

I haven't been stopping the daemon to edit them. I don't really understand how to use VI, so I edit them locally on my windows computer (first copying with WinSCP), then I copy the newly edited config files back using WinSCP, overwriting the old ones, and then I use /etc/init.d/transmission restart

One more question; am I supposed to see two running instances of Transmission in htop, both using the same amount of CPU and memory, but having different PIDs?

Code: Select all

PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 3353 root       20   0 19868 10668  1048 S 11.0 17.3 13:15.92 /usr/bin/transmission-daemon -g /root/.config/transmission-daemon
 3354 root       20   0 19868 10668  1048 S 11.0 17.3 13:14.75 /usr/bin/transmission-daemon -g /root/.config/transmission-daemon
(in case you were wondering, yes they both start at the same time with the start command, and they are both stopped at the same time using the /etc/init.d/transmission stop command)

I also just noticed that bind_address_ipv4 '192.168.1.1' in the transmission config file was actually set to bind-address-ipv4, with dashes instead of underscores. That probably didn't help.
moeburn
Posts: 10
Joined: Sat Aug 31, 2013 4:48 am

Re: Running it on a router - proper config?

Post by moeburn »

x190 wrote:
I haven't been stopping the daemon to edit them.
Then they would be overwritten by the defaults. You can't have 2 ipv4 bind addresses. Remove one line or the other in both files.

The second PID might just be a thread but maybe that is confusing your bandwidth monitor?
I already tried removing 192.168.1.1, leaving the 0.0.0.0, cause I couldn't remember why I added it in the first place, but it didn't seem to fix anything.


"they would be overwritten", by they you mean the config files? That's not true; every time I make changes, I first copy the config files over FROM the router, to make sure that I have the router's exact config to start with, just in case, and my changes have always been preserved. I would have thought they would only get overwritten if I tried to make config changes in the web UI in between changing the config files and restarting transmission. But I will stop it first, from now on, just in case.

Apparently there are actually 4 transmission threads running, but I only ever noticed 2 of them, because only 2 of them have any CPU usage. Is this what you mean by 'threads', when I check 'tree view' in htop, they show up like this:

Code: Select all

  490 root       20   0 15880  7420  1624 S 65.0 12.0  0:30.28 `- /usr/bin/transmission-daemon -g /root/.config/transmission-daemon
  501 root       20   0 15880  7420  1624 S  0.0 12.0  0:00.00 |  `- /usr/bin/transmission-daemon -g /root/.config/transmission-daemon
  496 root       20   0 15880  7420  1624 S  0.0 12.0  0:00.12 |  `- /usr/bin/transmission-daemon -g /root/.config/transmission-daemon
  491 root       20   0 15880  7420  1624 R 65.0 12.0  0:30.12 |  `- /usr/bin/transmission-daemon -g /root/.config/transmission-daemon
moeburn
Posts: 10
Joined: Sat Aug 31, 2013 4:48 am

Re: Running it on a router - proper config?

Post by moeburn »

Alright, it is definitely my Transmission configuration that is causing all of the problems on the router. Works fine without transmission. Works fine with default transmission config.

I backed up my settings.json and transmission config files, wiped and reflashed the router's firmware, and then I set it up with all the same router settings I was using before. No troubles so far. Then I installed Transmission, and started it using transmission-daemon -f. Still no problem, although this method of starting it just lets it create the default config files and run on a verbose command line, I can't access it using the web UI. So I stop Transmission with ctrl-c, then I copied my settings.json and transmission config files back over, and restarted transmission using /etc/init.d/transmission start and thats when the trouble starts. I am able to fix it by stopping Transmission and rebooting the router (something I should have tried before I wiped and reflashed...)

When I start Transmission, a second entry for 192.168.1.1 shows up in the Gargoyle Web UI's bandwidth monitor. The second entry shows identical data for the first entry. This screws up the web ui's bandwidth distribution table, which is a pie chart, because there are now two entries for Gargoyle/192.168.1.1, each showing the same amount of data usage. IE: Transmission downloads 1 GB torrent. Both entries for 192.168.1.1 in Gargoyle's bandwidth monitor show 1GB downloaded, each, which leads Gargoyle to think that there was a total of 2GB downloaded when drawing the pie chart, even though Gargoyle's own listing of "Total Bandwidth: Download" shows only 1GB.

I could do away with the pie chart, if it didn't also screw up the live bandwidth monitoring graph (which is how I check and see if Transmission has been maintaining good speeds, when during the day, and how fast), and the QoS bandwidth limiting. The live bandwidth monitoring chart sometimes shows the Transmission bandwidth listed under "192.168.1.1", and sometimes it just suddenly cuts off and disappears, and the bandwidth can't be found anywhere other than "Total bandwidth".

But the fact that it breaks QoS is the worst part. I need QoS working to limit Transmission's bandwidth usage when someone else on the network needs it. It was working for a while, before, so I know it's possible. But because of something I did to my config files, which makes this strange double entry for 192.168.1.1, QoS now doesn't know where the bandwidth is going, or how to limit it, so it just doesn't do a damn thing at all.

Can someone please have a look at my config files, and compare them to Transmission's default config files, and tell me which config entry it is that is likely creating the second listing for 192.168.1.1 in gargoyle's bandwidth monitoring systems? Is it the web UI that's doing it? Because it worked fine in the default config, which doesn't let me access the web UI, but my config breaks it, which has the Web UI all set up.
moeburn
Posts: 10
Joined: Sat Aug 31, 2013 4:48 am

Re: Running it on a router - proper config?

Post by moeburn »

nevermind, I think I figured it out. It was me port forwarding 58183 to 192.168.1.1. I didn't realise what I was supposed to do was uci to open the port, not forward it. That makes sense.
Post Reply