aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: 0001406: amule: UPnP failing to open ports on router from a multi-homed machine  (Read 5837 times)

Osiris X

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2

I have a multi-homed machine with 2 interfaces - eth0 (192.168.0.1) & eth1 (192.168.1.x). My router is
connected to eth1 and has ip address 192.168.1.254. When I run aMule on this machine it starts up and
appears to bind the UPnP port TCP/50000 to eth0 instead of eth1, regardless of whether I set a bind
address in the aMule preferences or not. (NB. according to 'netstat -ap' aMule binds the UPnP port
TCP/50000 to all interfaces). It then fails to detect any WAN service - see aMule log below:

2008-08-26 14:06:44: UPnPBase.cpp(868): Universal Plug and Play: bound to 192.168.0.1:50000.
2008-08-26 14:06:44: UPnPBase.cpp(939): Universal Plug and Play: UPnP Error:
CUPnPControlPoint::AddPortMapping: WAN Service not detected.

However a short time later, after 'Low-ID' connection to the ED2K network and 'firewalled' connection
to the KAD network, aMule finally notices that there is a UPnP capable router accessible through eth1
and the aMule log shows:

2008-08-26 14:22:11: UPnPBase.cpp(562): Universal Plug and Play: Uninteresting service detected:
'urn:schemas-upnp-org:service:WANDSLLinkConfig:1'. Ignoring.
2008-08-26 14:22:11: UPnPBase.cpp(545): Universal Plug and Play: WAN Service Detected:
'urn:schemas-upnp-org:service:WANIPConnection:1'.
2008-08-26 14:22:11: UPnPBase.cpp(1529): Universal Plug and Play: Successfully retrieved SCPD Document
for service urn:schemas-upnp-org:service:WANIPConnection:1, absEventSubURL:
http://192.168.1.254:80/upnp/event/igd/wanipcRoutedEthoA. [^]
2008-08-26 14:22:11: UPnPBase.cpp(1543): Universal Plug and Play: Successfully subscribed to service
urn:schemas-upnp-org:service:WANIPConnection:1, absEventSubURL:
http://192.168.1.254:80/upnp/event/igd/wanipcRoutedEthoA. [^]
2008-08-26 14:22:11: UPnPBase.cpp(562): Universal Plug and Play: Uninteresting service detected:
'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1'. Ignoring.
2008-08-26 14:22:11: UPnPBase.cpp(562): Universal Plug and Play: Uninteresting service detected:
'urn:schemas-upnp-org:service:Layer3Forwarding:1'. Ignoring.

However it still does not open any ports on my router (192.168.1.254).

Afterwards I periodically get the following message in the aMule log:

2008-08-26 14:52:02: UPnPBase.cpp(1338): Universal Plug and Play: UPNP_EVENT_AUTORENEWAL_FAILED:
Re-subscribed to EventURL 'http://192.168.1.254:80/upnp/event/igd/wanipcRoutedEthoA' [^] with SID ==
'uuid:28e0dce2-1dd2-11b2-91d7-f7e3500ea8f3'.

On reflection, it is entirely possible that this problem is router
specific.

My router is a Thomson Speedtouch 585 provided by the ISP Be (UK). This
router is highly configurable from a CLI, so maybe there are options I
could alter to make it work with aMule.

However it should be noted that the Deluge Bittorrent Client v0.5.9.3
and Skype v2.0.0.72 both successfully use UPnP to open ports on the
router when run from my debian linux system.

I am running an iptables firewall on this debian machine. Below are the rules
I have used allow UPnP SSDP packets (both to and from port 1900 and
multicast)

iptables -A INPUT -i [router if] -s [router ip] -d 224.0.0.0/4 -j ACCEPT
iptables -A INPUT -i [router if] -p udp -s [router ip] --sport 1900 --dport [ports 1025+] -j ACCEPT
iptables -A INPUT -i [router if] -p udp -s [router ip] --dport 1900 --sport [ports 1025+] -j ACCEPT

iptables -A OUTPUT -o [router if] -d 224.0.0.0/4 -j ACCEPT
iptables -A OUTPUT -o [router if] -p tcp --sport [ports 1025+] -j ACCEPT
iptables -A OUTPUT -o [router if] -p udp --sport [ports 1025+] -j ACCEPT

In addition I have added the following aMule specific rules relating to my
specific aMule config:

iptables -A INPUT -i [router if] -p tcp --dport [aMule TCP port] --sport [ports 1025+] -j ACCEPT(syn-flood checked)
iptables -A INPUT -i [router if] -p udp --dport [aMule UDP port] --sport [ports 1025+] -j ACCEPT
iptables -A INPUT -i [router if] -p udp --dport [aMule Extended UDP port] --sport [ports 1025+] -j ACCEPT
iptables -A INPUT -i [router if] -p tcp --dport [aMule UPnP port] --sport [ports 1025+] -j ACCEPT(syn-flood checked)

I believe these rules should be sufficient.

Any ideas on how I can fix this? Is this something that tweaking a parameter in the source and
re-compiling could fix?

Any help, pointers or solutions on how to aMule UPnP to successfully open
ports on my router would be most welcome.

Thanks in advance.

Os

aMule BugTracker Report:
http://bugs.amule.org/view.php?id=1406

Debian Bug Report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496654

-- System Information:
Debian Release: lenny/sid
Kernel: Linux 2.6.26
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
aMule Version: 2.2.2

Versions of packages amule depends on:
ii amule-common 2.2.2-1 common files for amule
ii amule-i18n-en-gb [a 2.2.2-1 English (en_GB) internationalized
ii binutils 2.18.1~cvs20080103-7 The GNU assembler, linker and bina
ii libc6 2.7-13 GNU C Library: Shared libraries
ii libcrypto++7 5.5.2-2 General purpose cryptographic shar
ii libgcc1 1:4.3.1-2 GCC support library
ii libgeoip1 1.4.4.dfsg-3 A non-DNS IP-to-country resolver l
ii libstdc++6 4.3.1-2 The GNU Standard C++ Library v3
ii libupnp3 1:1.6.6-3 Portable SDK for UPnP Devices (sha
ii libwxbase2.8-0 2.8.7.1-1 wxBase library (runtime) - non-GUI
ii libwxgtk2.8-0 2.8.7.1-1 wxWidgets Cross-platform C++ GUI t
ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime
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

Hi Osiris X,

Sorry for taking so long to answer.

Could you please enable the UPnP debug messages on Preferences->debug and post the log here? It will be a long log, if you prefer, post it as a zipped archive.

One thing that you can try is to disable iptables completely for a quick test and then reenable it again so that we make sure it is not an iptables issue.

In my machine, I also have opened:
# tcp dest 50000 - UPnP
# udp dest 1900  - UPnP
# udp source 1900  - UPnP -> makes things quicker
« Last Edit: September 12, 2008, 02:10:10 PM by phoenix »
Logged

Osiris X

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2

Please find attached my gzip'd aMule logfile as requested.

I disabled iptables completely but it made no difference, so I am pretty confident it is not an iptables issue. Bizarrely, I was not able to get aMule to generate some of the actions/output that I originally saw and included in my 1st post. Most notably it doesn't seem to detect http://192.168.1.254:80/upnp/event/igd/wanipcRoutedEthoA at all now.

Please note that both Deluge and Skype correctly activate UPnP port forwarding on my (Be Branded) Speetouch 585 router.

Any help, pointers or solutions on how to aMule UPnP to successfully open
ports on my router would be most welcome.

Thanks in advance.

Os
Logged