MLDonkey Forum Index
Homepage •  Bugs •  Tasks •  Patches •  SF.net Project Page •  ChangeLog •  German forum •  Links •  Wiki •  Downloads
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Choose interface

 
Post new topic   Reply to topic    MLDonkey Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Paranoik
neophyte


Joined: 10 Apr 2009
Posts: 19

PostPosted: Fri Oct 16, 2009 12:52 pm    Post subject: Choose interface Reply with quote

Hi, I have two Internet interfaces. How to make MLdonkey work from certain one?
Back to top
View user's profile Send private message
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 3776
Location: Germany

PostPosted: Fri Oct 16, 2009 9:22 pm    Post subject: Reply with quote

Use option client_bind_addr
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
Paranoik
neophyte


Joined: 10 Apr 2009
Posts: 19

PostPosted: Mon Oct 19, 2009 6:51 am    Post subject: Reply with quote

spiralvoice wrote:
Use option client_bind_addr


Good idea, but both of interfaces uses DHCP, maybe there is other way?
Back to top
View user's profile Send private message
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 3776
Location: Germany

PostPosted: Mon Oct 19, 2009 2:35 pm    Post subject: Reply with quote

I do not think so.
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 3776
Location: Germany

PostPosted: Thu Oct 22, 2009 5:55 am    Post subject: Reply with quote

Another way just came to my mind.

Option client_bind_addr can not be changed
on the fly, it requires a restart of MLDonkey.

When your machine boots it will acquire a
DHCP IP before MLDonkey starts. This IP
can be used as parameter when starting
MLDonkey:

mlnet -client_bind_addr a.b.c.d
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
Paranoik
neophyte


Joined: 10 Apr 2009
Posts: 19

PostPosted: Thu Oct 29, 2009 8:56 am    Post subject: Reply with quote

Good idea, but intresting what will happen if ip will change while mldon is running. Because my server is 24hour online. So it is starts and stops very rare.
Back to top
View user's profile Send private message
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 3776
Location: Germany

PostPosted: Thu Oct 29, 2009 10:14 am    Post subject: Reply with quote

Paranoik wrote:
what will happen if ip will change while mldon is running

When MLdonkey creates the listening port other
clients can connect to, like ED2K-port. it uses
the current value of client_bind_addr.
This socket is open until MLDonkey is shutting
down, therefore later changes to option
client_bind_addr while MLDonkey is running
will have no effect.
If your machine receives a new DHCP IP without
being restarted you need to restart MLDonkey
using ifup and ifdown.
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
Paranoik
neophyte


Joined: 10 Apr 2009
Posts: 19

PostPosted: Wed Nov 04, 2009 3:14 pm    Post subject: Reply with quote

Hi SpiralVoice,

I made as you told, and wrote script that restarts mldonkey each time ip is changed on IFACE.
here it is:

Code:
#!/bin/bash
DT=`date +'%Y/%m/%d %H:%M:%S [cIP]'`
IPOLD=`cat /home/maksim/ip.txt`
IP=`/sbin/ifconfig ppp10002 | grep 'inet addr:'| cut -d: -f2 | awk '{ print $1}'`
if [ $IPOLD == $IP ]; then
     echo $DT 'IP не поменялся:' $IP  >> /var/log/mldonkey.log
     exit 0;
else
     echo $IP > /home/maksim/ip.txt
     echo $DT 'IP поменялся, старый' $IPOLD',новый' $IP  >> /var/log/mldonkey.log
     rm -f /home/maksim/config.cfg
     /etc/init.d/mldonkey stop
     rm /home/mldonkey/.mldonkey/files.ini.tmp
     rm /home/mldonkey/.mldonkey/downloads.ini.tmp
     rm /home/mldonkey/.mldonkey/fasttrack.ini.tmp
     rm /home/mldonkey/.mldonkey/donkey.ini.tmp
     rm /home/mldonkey/.mldonkey/bittorrent.ini.tmp
     head -n 517 /home/mldonkey/.mldonkey/downloads.tmp >> /home/maksim/config.cfg && echo ' client_bind_addr = "'$IP'"' >> /home/maksim/config.cfg && tail -n 530 /home/mldonkey/.mldonkey/downloads.tmp  >> /home/maksim/config.cfg
     sleep 3
     mv -f /home/maksim/config.cfg /home/mldonkey/.mldonkey/downloads.ini
     /etc/init.d/mldonkey start
fi


Everything worked for some time, but today i faced with next problem
IP Discover doesn't work.

Code:
2009/11/04 17:00:33 [cCO] Started download of Betmen_Nachalo[tfile.ru].avi, user:group maksim:maksim
2009/11/04 17:00:33 [cCO] Options correctly saved
2009/11/04 17:00:33 [dMain] loading contact.dat from web_infos/contact.dat
2009/11/04 17:00:33 [OV] Overnet module is disabled, ignoring...
2009/11/04 17:00:33 [dMain] loading geoip.dat from web_infos/GeoIP.dat.gz
2009/11/04 17:00:34 [Geo] country edition database loaded
2009/11/04 17:00:34 [dMain] loading server.met from web_infos/server.met.gz
2009/11/04 17:00:34 [EDK] eDonkey module is disabled, ignoring...
2009/11/04 17:00:34 [dMain] loading guarding.p2p from web_infos/level1.gz
2009/11/04 17:00:34 [IPblock] loading web_infos/level1.gz
2009/11/04 17:00:37 [IPblock] 224222 ranges loaded - optimized to 199377
2009/11/04 17:00:37 [dMain] loading nodes.gzip from web_infos/nodes.gzip
2009/11/04 17:00:37 [Fasttrack] nodes.gzip loaded from http://update.kceasy.com/update/fasttrack/nodes.gzip
2009/11/04 17:00:37 [cO] started IP discovery
2009/11/04 17:00:37 [dMain] Check http://www.mldonkey.org for updates
2009/11/04 17:00:37 [dMain] enabling networks:
2009/11/04 17:00:37 [dMain] ---- enabling BitTorrent ----
2009/11/04 17:00:37 [dMain] using port 6882 (client_port TCP)
2009/11/04 17:00:37 [dMain] using port 6881 (tracker_port TCP)
2009/11/04 17:00:37 [dMain] ---- enabling FileTP ----
2009/11/04 17:00:37 [dMain] ---- enabling interfaces ----
2009/11/04 17:00:37 [dMain] using port 4080 (http_port)
2009/11/04 17:00:37 [dMain] using port 4000 (telnet_port)
2009/11/04 17:00:37 [dMain] using port 4001 (gui_port)
2009/11/04 17:00:37 [dMain] disabled networks: Donkey Fasttrack
2009/11/04 17:00:37 [dMain] To command: telnet 127.0.0.1 4000
2009/11/04 17:00:37 [dMain] Or with browser: http://127.0.0.1:4080
2009/11/04 17:00:37 [dMain] For a GUI check out http://sancho-gui.sourceforge.net
2009/11/04 17:00:37 [dMain] Connect to IP 127.0.0.1, port 4001
2009/11/04 17:00:37 [dMain] If you connect from a remote machine adjust allowed_ips
2009/11/04 17:00:37 [dMain] mldonkey is now running as user mldon
2009/11/04 17:00:37 [cCO] Options correctly saved
2009/11/04 17:00:37 [dMain] Activated system signal handling
2009/11/04 17:00:37 [dMain] Starting with pid 25175
2009/11/04 17:00:37 [dMain] Core started

It is stopped to work. i noticed if IP detects correctly then it works fine. Why is possible that it doesn't detect ip?

my downloads.ini http://ifolder.ru/14838385.
Back to top
View user's profile Send private message
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 3776
Location: Germany

PostPosted: Wed Nov 04, 2009 5:23 pm    Post subject: Reply with quote

Paranoik wrote:
Code:
     head -n 517 /home/mldonkey/.mldonkey/downloads.tmp >> /home/maksim/config.cfg && echo ' client_bind_addr = "'$IP'"' >> /home/maksim/config.cfg && tail -n 530 /home/mldonkey/.mldonkey/downloads.tmp  >> /home/maksim/config.cfg

Why not use sed instead of splitting the file? untested:
Code:
sed -i -e 's#\(client_bind_addr = \).*#\1'$IP'#g' /home/mldonkey/.mldonkey/downloads.ini

Paranoik wrote:
IP Discover doesn't work.

It is using a 3rd-party service, maybe it does not work always.
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
Paranoik
neophyte


Joined: 10 Apr 2009
Posts: 19

PostPosted: Wed Nov 04, 2009 9:02 pm    Post subject: Reply with quote

thanks for reply, i didn't use sed because i am really new in linux.

but your string should be like this:
Code:
sed -i -e 's#\(client_bind_addr = \).*#\1"'$IP'"#g' /home/mldonkey/.mldonkey/downloads.ini


About Discover IP. Service is working perfect: http://whatismyip.org/

i have no more idea really.
Why if i use client_ip it isn't work?

i tried to change discover_ip = false and force_client_ip = true.
and
Code:
sed -i -e 's#\(client_ip = \).*#\1"'$IP'"#g' /home/mldonkey/.mldonkey/downloads.ini

it isn't work?
Back to top
View user's profile Send private message
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 3776
Location: Germany

PostPosted: Thu Nov 05, 2009 7:20 pm    Post subject: Reply with quote

It will work only if $IP is a WAN IP.
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MLDonkey Forum Index -> General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Sourceforge.net Logo