aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Source IP on machines with multiple ips  (Read 5899 times)

hell

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 1
    • http://netexpert.hu
Source IP on machines with multiple ips
« on: September 26, 2004, 02:41:43 AM »

it would be essential to have a possibility to set the source ip address which amule will sit on
in case of machines with more than a single ip address
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Source IP on machines with multiple ips
« Reply #1 on: September 26, 2004, 01:25:40 PM »

hell,

Please, explain me better your situation, I am probably missing something.

What I can tell you is that it is not up to the program to decide through which interface the package will go through, that is a job for the routing tables inside the kernel. So, maybe a proper routing table configuration is what you need. But I advise you, this is a complicated thing to do.

Unless the addresses of both interfaces are on the same network, it will be very hard for the kernel to figure out which package you want to go through which interface.

Cheers!
Logged

lfroen

  • Guest
Re: Source IP on machines with multiple ips
« Reply #2 on: September 27, 2004, 11:01:05 AM »

Actually this is nice feature. I think it would be nice if user can choose on which interface amule is listening on.
phoenix: this is not complicated thing to do. And it have nothing to do with kernel routing tables
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Source IP on machines with multiple ips
« Reply #3 on: September 27, 2004, 11:29:01 AM »

lfroen,

Like I said, I was missing something.
Choose the ip address where you listen is indeed a nice feature. Maybe we can do this for the next release.

Cheers!
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: Source IP on machines with multiple ips
« Reply #4 on: September 27, 2004, 06:04:10 PM »

no more then 5 minutes of coding.
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Source IP on machines with multiple ips
« Reply #5 on: September 27, 2004, 07:10:18 PM »

plus one hour to put it in the preferences without breaking everything :D
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: Source IP on machines with multiple ips
« Reply #6 on: September 27, 2004, 07:34:35 PM »

What about allowing the user to choose not only an IP address, but a DNS name? (e.g. for clients connecting with dynamic IPs, they might have a fix DNS name such as .dyndns.org)

This feature would make possible to create a sourcelink with hostname aswell.
Logged
concordia cum veritate

freezer

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: Source IP on machines with multiple ips
« Reply #7 on: October 18, 2004, 07:35:02 PM »

Hi,

Also need this feature!

Pls implent it soon, if it doesnt take much time as you wrote! :-)

I have also several IPs and want to give amule an specific one!I think this is really a highly needed feature for many users!So i think it´s worth the time for implementation :-)


Greetz

Freezer
« Last Edit: October 18, 2004, 07:36:48 PM by freezer »
Logged

lfroen

  • Guest
Re: Source IP on machines with multiple ips
« Reply #8 on: October 19, 2004, 12:11:01 PM »

Short answer: not possible.
Long answer:
amule is using network thru TCP sockets (on transmit side). At this point application can not choose routing path for outgoing packets. This is how network work. If you DO want to choose for application X routing path 1 and for application Y routing path 2 - this is up to you operating system to decide. Linuxes can use iptables for this task.
What application CAN choose - on which interface it will listen on. For example, if you have 4 network cards with 4 ips where 2 is your local subnet and 2 is link to internet, application can choose not to listen on private ip (like 10.x.x.x etc) and listen only on interfaces to internet.
However, if you have more than 1 interface to internet, application MUST listen on both. Why - becouse router doesn't know where you listen before it forwards SYN packet. If router chooses to send it to interface where you not listening, client will thing that "nothing there" and this is not your intention. Since you don't want this to happen - amule listening on 0.0.0.0.
Logged

freezer

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: Source IP on machines with multiple ips
« Reply #9 on: October 19, 2004, 04:55:29 PM »

Mh, i wont believe that this is not possible!Many programs are supporting this feature!Such as bittorrent clients etc.

I asked in several debian and linux channels, how i can bind one ip to amule with iptables.The answer was always not possible with iptables!

So you maybe misunderstand something?I only want to bind a ip to amule.This IP is on the same eth interface as an alias(My ISP provides more than one IP).

I really think it IS possible!Because not at least many programs support the bind ip function, so if its not possible, how can they do that!? :)


Greetz
Logged

lfroen

  • Guest
Re: Source IP on machines with multiple ips
« Reply #10 on: October 19, 2004, 08:21:30 PM »

So yes, you do missunderstand :
You messing up "bind" and "send thru". Yes, program can choose what interface TO BIND, but in CAN NOT choose thru which interface TO SEND.

So, you can't BIND with iptables, you can choose ROUTING PATH with iptables.
Once you cleary understand the difference bitween the two, you will understand my above answer.
Logged