MLDonkey

Debian packages

The following Debian packages need to be installed

mldonkey-server


References

Homepage

http://mldonkey.sourceforge.net/Main_Page

Traffic shaping

http://mldonkey.sourceforge.net/TrafficShaping


Configuration

dpkg Questions

Most of the answers to the following questions are stored in

/etc/default/mldonkey-server

Q&A:

  • Launch MLDonkey at startup = no
  • user = mldonkey
  • group = mldonkey
  • directory = /var/lib/mldonkey
  • niceness = 0
  • max download speed = 50
  • max upload speed = 30
  • maximal time to live = 168 (= 1 week))
  • admin user password = <secret>


Various .ini files

While the server is stopped, edit the following files

/var/lib/mldonkey/downloads.ini
/var/lib/mldonkey/donkey.ini

(more files may be required if you have enabled more networks such as BitTorrent or Overnet)

Most options can also be specified through the Web interface while the server is running.


downloads.ini

  • client_name = osgiliath.herzbube.ch (this may be an arbitrary nickname)
  • http_port = 4080 (default value)
  • telnet_port = 4000 (default value)
  • gui_port = 4001 (default value)
  • max_hard_upload_rate = 30
    • this is also set by answering a dpkg-reconfigure question
  • max_hard_download_rate = 50
    • this is also set by answering a dpkg-reconfigure question
  • allowed_ips = ["127.0.0.1"; "192.168.1.0/24";]
    • if this is changed in the Web interface, values must be entered separated by spaces
    • if entered in the Web interface using the command syntax (set xxx=yyy), the two values must be surrounded by ""
  • smtp_server = 127.0.0.1
  • mail = herzbube@herzbube.ch
  • run_as_user = mldonkey
    • this is also set by answering a dpkg-reconfigure question
  • run_as_useruid = 104 (must correspond to username entered above)
    • this is also set by answering a dpkg-reconfigure question
  • auto_commit = true


donkey.ini

  • port = 4662 (this is the default)
    • this is the TCP port; the UDP port automatically calculates as TCP+4 = 4666


Other options

Hints collected from various sources:

  • use_file_history = false
    • to save memory
  • max_concurrent_downloads = 30
    • empirical value; 60 is too high
  • incoming_directory_prio = 0
    • to prevent the incoming directory to be shared
  • max_reask_delay >= 1800
    • to prevent eMules from kicking MLDonkey out of their queue because MLDonkey did not connect for some time
  • web_infos =
[
  ("server.met", 1, "http://www.mrhussein.net/edonkey/serverliste/maurice/max/server.met");
  ("server.met", 1, "http://www.esel-paradies.de/liste/server.met");
  ("server.met", 1, "http://ocbmaurice.dyndns.org/pl/slist.pl/server.met?download/server-max.met");
  ("server.met", 1, "http://tdn-serverlist.no-ip.org/pl/serverlist.pl?filter=i:-10;&sort=!rank&template=standard");
  ("server.met", 1, "http://tdn-serverlist.no-ip.org/pl/serverlist.pl?filter=i:-10;&sort=!users&template=standard");
  ("server.met", 1, "http://www.primusnet.ch/users/komintern/ed2k/min/server.met");
  ("server.met", 1, "http://ocbmaurice.dyns.net/pl/slist.pl?download/server-good.met");
  ("server.met", 1, "http://ocbmaurice.dyns.net/pl/slist.pl?download/server-best.met")
]
  • donkey.ini: max_connected_servers = 1
    • not necessary to set more than 1 because MLDonkey can communicated over UDP (which is connectionless)
  • donkey.ini: master_server_min_users = 0
    • has to do with max_xonnected_servers
  • server_connection_timeout = 15
  • update_server_list = true
    • server list is updated automatically
  • max_server_age = 1
    • server is removed from list if there was no connection for more than 1 day
  • min_left_servers = 50
    • the minimum number of servers that are always left in the list, even if servers within this limit have reached their max_server_age
    • the default 200 is too high
    • this value should not be too high if one does not want to make too many useless connections to old servers
  • max_sources_per_file = 200
    • default value 500 is too high
  • min_left_sources = 0
    • to remove old sources that went dead
    • otherwise packets are sent to hosts that have changed their IP address long ago (dynmaic IPs)
  • max_source_age = 1
    • sources are removed if they were not connected for more than 1 day
    • default 3 is too high
  • max_upload_slots = 10

Another useful thing might be to use iptables to filter out badly configured clients that use 192.168... IP addresses:

EXTIF=ppp+

# set default policies, flush previous firewalling rules...
[...]

# discard packets coming with broken source IP
ipchains -A input -l -i $EXTIF -s 192.168.0.0/16 -j DENY
ipchains -A input -l -i $EXTIF -s 172.16.0.0/12 -j DENY
ipchains -A input -l -i $EXTIF -s 10.0.0.0/8 -j DENY

# immediately abort outgoing connections to broken IPs
ipchains -A output -l -i $EXTIF -d 192.168.0.0/16 -j REJECT
ipchains -A output -l -i $EXTIF -d 172.16.0.0/12 -j REJECT
ipchains -A output -l -i $EXTIF -d 10.0.0.0/8 -j REJECT