aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: How to listen on specic addresses?  (Read 14865 times)

Uqbar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
How to listen on specic addresses?
« 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:
  • amuleweb doesn't start anymore.
  • there's no similar setting for amuleweb so it's listening on all interfaces/IPs.
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!
Logged

Uqbar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: How to listen on specic addresses?
« Reply #1 on: May 30, 2017, 09:05:07 AM »

UPDATE!
You cannot: it's a bug!
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: How to listen on specic addresses?
« Reply #2 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 :)
Logged
concordia cum veritate

Uqbar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: How to listen on specic addresses?
« Reply #3 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.
Logged

Uqbar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: How to listen on specic addresses?
« Reply #4 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.
Logged