Unable to use with external NIC that has IP alias

Bug #1533384 reported by Jim Watson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
miniupnpd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

  I connect to the Internet via a BEC ADSL modem/router set up in bridge mode. The result of this is that I get a real (static) IP from my provider, but there is also a RFC1918 address used to manage it. And that I have assigned as an alias on my server NIC. The problem is specifying that in /etc/default/miniupnd file via MiniUPnPd_EXTERNAL_INTERFACE. When /etc/init.d/miniupnpd executes this line:

EXTIP="$(LC_ALL=C ${IP} addr show ${MiniUPnPd_EXTERNAL_INTERFACE} | grep "inet " | awk '{ print $2 }' | cut -d"/" -f1)"

  It will return all of the IP addresses assigned to that NIC. I fixed this on my system by adding '-m 1' to grep, like this:

EXTIP="$(LC_ALL=C ${IP} addr show ${MiniUPnPd_EXTERNAL_INTERFACE} | grep -m 1 "inet " | awk '{ print $2 }' | cut -d"/" -f1)"

  That will of course mean that your external IP must be the first assignment for that NIC, and that should be noted in the default file.

  With that said, the /etc/miniupnpd/miniupnpd.conf file specifically mentions the ability to use multiple external IP's (if it's compiled in), and the supplied init.d file does not support it. It wouldn't take much to make the init create the appropriate chains, but deleting the old ones after a config change would require some thought. And you'd still need the '-m 1' :)

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: miniupnpd 1.8.20140523-4
ProcVersionSignature: Ubuntu 4.2.0-16.19-generic 4.2.3
Uname: Linux 4.2.0-16-generic x86_64
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
Date: Tue Jan 12 15:18:25 2016
InstallationDate: Installed on 2016-01-11 (1 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
ProcEnviron:
 LANGUAGE=en_US
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: miniupnpd
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jim Watson (ay-ubuntu) wrote :
Yangfl (mmyangfl)
Changed in miniupnpd (Ubuntu):
status: New → Opinion
status: Opinion → New
Revision history for this message
Yangfl (mmyangfl) wrote :

Your idea is worthwhile. However, the problem remains: which one is your wan ip? In your case it's the first one, in others' it may be the second one, the third one, that could be endless, not to say in some extreme situations, such ip will not show on the interface (behind DNAT). Much worse, miniupnpd itself will detect wan ip within the program when you don't tell it the external ip, which is far from init script can manage.

By the way, multiple external IP is yet another buggy thing which I'm not going to fix (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685649#32 ).

Nevertheless, I will try to figure out how miniupnpd detects external ip and make init script behave the same as it (which might be just exactly '-m 1').

Changed in miniupnpd (Ubuntu):
status: New → In Progress
Yangfl (mmyangfl)
Changed in miniupnpd (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.