aMule Forum

English => en_Linux => Topic started by: Uqbar on May 26, 2017, 08:10:01 PM

Title: How to listen on specic addresses?
Post by: Uqbar on May 26, 2017, 08:10:01 PM
Hi all.
I have installed amule-daemon on mu Ubuntu 16.04.2.
The package version is said to be "2.4.0~git20151120.0023527bc2-1ubuntu1".

In order to have amuled listen only on a specific interface I have manually setup the
Code: [Select]
ECAddress=127.0.0.42This works as i can check the process is listening only on 127.0.0.42.
But then I have two issues:
Without that setting, amuleweb is starting normally. With it I cannot see it (with neither "netstat -l" nor "ps ax"), despite the log says:

Code: [Select]
Command ''amuleweb' '--amule-config-file=/home/auser/.aMule/amule.conf'' with pid '25155' has finished with status code '0'.
Surely I am doing something wrong. Any hint?
Then, is there a way to accomplish the task with item no.2 without firewalling?
TALIA!
Title: Re: How to listen on specic addresses?
Post by: Uqbar on May 30, 2017, 09:05:07 AM
UPDATE!
You cannot: it's a bug (http://bugs.amule.org/view.php?id=955)!
Title: Re: How to listen on specic addresses?
Post by: GonoszTopi on June 02, 2017, 12:04:43 PM
amuleweb doesn't start anymore.

When you start amuleweb from amule(d) it unconditionally tries to connect to localhost, 127.0.0.1. But since you're accepting connections only from 127.0.0.42 it obviously doesn't work.

I wrote it up to my personal to-do list, but I cannot guarantee it will be fixed by tomorrow :)
Title: Re: How to listen on specic addresses?
Post by: Uqbar on June 02, 2017, 12:07:58 PM
I think you are right: thanks.
As there is too few logging from amuleweb, I had no clue.
For sure amuleweb should connect where the EC* settings say, nowhere else.
Title: Re: How to listen on specic addresses?
Post by: Uqbar on June 28, 2017, 12:10:29 PM
UPDATE + WORKAROUND

On my system I am using now iptables (sw firewall) to make those TCP ports unavailable but loopback.

First, I have checked which actual addresses where in use:

Code: [Select]
sudo netstat -tnp | grep -e 4711 -e 4712
and found that only 127.0.0.1 and 127.0.0.42 where in use, as per my configuration, by amuled and amuleweb.
Then I have run and added to the /etc/rc.local these two lines:

Code: [Select]
iptables -A INPUT -d <YOUR_IP_HERE> -p tcp --dport 4711 -j DROP #amuleweb
iptables -A INPUT -d <YOUR_IP_HERE> -p tcp --dport 4712 -j DROP #amuled

Of course, if you have more than one IP other than the loopback, hen you need to replicate those two lines with the proper extra IP addresses.