Forums

Mansoor
Mansoor
Offline
Resolved
0 votes
I installed miniupnp from the market on a clearos 7.6 community server. The installation was successful but the process failed to start. Here is what I found in the messages log:

Sep 22 05:54:57 gateway yum[27414]: Installed: miniupnpd-2.1-12.v7.x86_64
Sep 22 05:54:58 gateway miniupnp-options: WAN=-i enp0s31f6#012p3p1 LAN=-a lo Options=
Sep 22 05:54:58 gateway miniupnpd: Usage:
Sep 22 05:54:58 gateway miniupnpd: /usr/sbin/miniupnpd [-f config_file] [-i ext_ifname] [-o ext_ip]
Sep 22 05:54:58 gateway miniupnpd: [-a listening_ip] [-p port] [-d] [-U] [-S] [-N]
Sep 22 05:54:58 gateway miniupnpd: [-u uuid] [-s serial] [-m model_number]
Sep 22 05:54:58 gateway miniupnpd: [-t notify_interval] [-P pid_filename]
Sep 22 05:54:58 gateway miniupnpd: [-B down up] [-w url] [-r clean_ruleset_interval]
Sep 22 05:54:58 gateway miniupnpd: [-A "permission rule"] [-b BOOTID]
Sep 22 05:54:58 gateway miniupnpd: Notes:
Sep 22 05:54:58 gateway miniupnpd: There can be one or several listening_ips.
Sep 22 05:54:58 gateway miniupnpd: Notify interval is in seconds. Default is 30 seconds.
Sep 22 05:54:58 gateway miniupnpd: Default pid file is '/var/run/miniupnpd.pid'.
Sep 22 05:54:58 gateway miniupnpd: Default config file is '/etc/miniupnpd.conf'.
Sep 22 05:54:58 gateway miniupnpd: With -d miniupnpd will run as a standard program.
Sep 22 05:54:58 gateway miniupnpd: -S sets "secure" mode : clients can only add mappings to their own ip
Sep 22 05:54:58 gateway miniupnpd: -U causes miniupnpd to report system uptime instead of daemon uptime.
Sep 22 05:54:58 gateway miniupnpd: -N enables NAT-PMP functionality.
Sep 22 05:54:58 gateway miniupnpd: -B sets bitrates reported by daemon in bits per second.
Sep 22 05:54:58 gateway miniupnpd: -w sets the presentation url. Default is http address on port 80
Sep 22 05:54:58 gateway miniupnpd: -A use following syntax for permission rules :
Sep 22 05:54:58 gateway miniupnpd: (allow|deny) (external port range) ip/mask (internal port range)
Sep 22 05:54:58 gateway miniupnpd: examples :
Sep 22 05:54:58 gateway miniupnpd: "allow 1024-65535 192.168.1.0/24 1024-65535"
Sep 22 05:54:58 gateway miniupnpd: "deny 0-65535 0.0.0.0/0 0-65535"
Sep 22 05:54:58 gateway miniupnpd: -b sets the value of BOOTID.UPNP.ORG SSDP header
Sep 22 05:54:58 gateway miniupnpd: -h prints this help and quits.
Sep 22 05:54:58 gateway systemd: miniupnpd.service: control process exited, code=exited status=1
Sep 22 05:54:58 gateway yum[27414]: Installed: 1:app-miniupnpd-core-1.0.0-2.v7.noarch
Sep 22 05:54:58 gateway systemd: Failed to start UPnP device server..
Sep 22 05:54:58 gateway systemd: Unit miniupnpd.service entered failed state.
Sep 22 05:54:58 gateway systemd: miniupnpd.service failed.
Sep 22 05:54:58 gateway yum[27414]: Installed: 1:app-miniupnpd-1.0.0-2.v7.noarch
Sep 22 05:54:59 gateway miniupnp-options: WAN=-i enp0s31f6#012p3p1 LAN=-a lo Options=
Sep 22 05:54:59 gateway miniupnpd: Usage:
Sep 22 05:54:59 gateway miniupnpd: /usr/sbin/miniupnpd [-f config_file] [-i ext_ifname] [-o ext_ip]
Sep 22 05:54:59 gateway miniupnpd: [-a listening_ip] [-p port] [-d] [-U] [-S] [-N]
Sep 22 05:54:59 gateway miniupnpd: [-u uuid] [-s serial] [-m model_number]
Sep 22 05:54:59 gateway miniupnpd: [-t notify_interval] [-P pid_filename]
Sep 22 05:54:59 gateway miniupnpd: [-B down up] [-w url] [-r clean_ruleset_interval]
Sep 22 05:54:59 gateway miniupnpd: [-A "permission rule"] [-b BOOTID]
Sep 22 05:54:59 gateway miniupnpd: Notes:
Sep 22 05:54:59 gateway miniupnpd: There can be one or several listening_ips.
Sep 22 05:54:59 gateway miniupnpd: Notify interval is in seconds. Default is 30 seconds.
Sep 22 05:54:59 gateway miniupnpd: Default pid file is '/var/run/miniupnpd.pid'.
Sep 22 05:54:59 gateway miniupnpd: Default config file is '/etc/miniupnpd.conf'.
Sep 22 05:54:59 gateway miniupnpd: With -d miniupnpd will run as a standard program.
Sep 22 05:54:59 gateway miniupnpd: -S sets "secure" mode : clients can only add mappings to their own ip
Sep 22 05:54:59 gateway miniupnpd: -U causes miniupnpd to report system uptime instead of daemon uptime.
Sep 22 05:54:59 gateway miniupnpd: -N enables NAT-PMP functionality.
Sep 22 05:54:59 gateway miniupnpd: -B sets bitrates reported by daemon in bits per second.
Sep 22 05:54:59 gateway miniupnpd: -w sets the presentation url. Default is http address on port 80
Sep 22 05:54:59 gateway miniupnpd: -A use following syntax for permission rules :
Sep 22 05:54:59 gateway miniupnpd: (allow|deny) (external port range) ip/mask (internal port range)
Sep 22 05:54:59 gateway miniupnpd: examples :
Sep 22 05:54:59 gateway miniupnpd: "allow 1024-65535 192.168.1.0/24 1024-65535"
Sep 22 05:54:59 gateway miniupnpd: "deny 0-65535 0.0.0.0/0 0-65535"
Sep 22 05:54:59 gateway miniupnpd: -b sets the value of BOOTID.UPNP.ORG SSDP header
Sep 22 05:54:59 gateway miniupnpd: -h prints this help and quits.
Sep 22 05:54:59 gateway systemd: miniupnpd.service: control process exited, code=exited status=1
Sep 22 05:54:59 gateway systemd: Failed to start UPnP device server..
Sep 22 05:54:59 gateway systemd: Unit miniupnpd.service entered failed state.
Sep 22 05:54:59 gateway systemd: miniupnpd.service failed.
...

I tried to look at /etc/miniupnpd.conf but no such file was found.

Any idea how to overcome this issue?

Thank you
Sunday, September 22 2019, 03:41 AM
Share this post:
Responses (7)
  • Accepted Answer

    Mansoor
    Mansoor
    Offline
    Tuesday, September 24 2019, 10:24 PM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:
    Perhaps I should include an MINIUPNPD_WAN override mechanism so you can manually specify it in /etc/miniupnpd/miniupnpd_clearos.conf if you want.

    Yes, this would be good enough.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, September 24 2019, 08:05 AM - #Permalink
    Resolved
    0 votes
    I think miniupnpd is always going to struggle in your case and it may well not be safe for other people to use the modified command. They may need to use a higher metric or an interface without a metric. It may be possible to pick up the EXTIF parameter from /etc/clearos/network.conf but it would still require special handling for MultiWAN and I know from experience it is possible to have non-existent values there if you do a network reconfiguration changing NIC's.

    Perhaps I should include an MINIUPNPD_WAN override mechanism so you can manually specify it in /etc/miniupnpd/miniupnpd_clearos.conf if you want.
    The reply is currently minimized Show
  • Accepted Answer

    Mansoor
    Mansoor
    Offline
    Monday, September 23 2019, 10:45 PM - #Permalink
    Resolved
    0 votes
    Thank you Nick. The miniupnp is now working after changing the line in /etc/miniupnpd/init_clearos.sh

    As for the second network interface (p3p1), it's not defined in clearos at all, though the system can still see it. My clearos server is working as a hypervisor as well, and the p3p1 is being used with a kvm virtual machine.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, September 23 2019, 08:56 PM - #Permalink
    Resolved
    0 votes
    Try changing the line in /etc/miniupnpd/init_clearos.sh from:
    MINIUPNPD_WAN="-i `LC_ALL=C ip -4 route | grep 'default' | sed -e 's/.*dev[[:space:]]*//' -e 's/[[:space:]].*//'`"
    to:
    MINIUPNPD_WAN="-i `LC_ALL=C ip -4 route | grep 'default' | sed -e 's/.*dev[[:space:]]*//g' | awk '{print $1 " " $5}' | sort -k2 -n | head -n 1 | awk '{print $1}'`"
    This should pick out the route with the lower metric, or if two are the same, it will pick up one the first (I think).

    Note miniupnpd from upstream does not really support multiwan. This script is only a kludge and may not work with the underlying app. I think it will work with their script, /etc/miniupnpd/miniupnpd_functions.sh, but I don't know if miniupnpd will work itself.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, September 23 2019, 08:28 PM - #Permalink
    Resolved
    0 votes
    So you have a very odd MultiWAN. How do you have two interfaces on the same subnet? That does not normally work as intended.

    The bigger issue is that my script, /etc/miniupnpd/init_clearos.sh, will only work with one default interface. It may be possible to do something with the metric to select one of them. What is your scripting like? Are you able to help?
    The reply is currently minimized Show
  • Accepted Answer

    Mansoor
    Mansoor
    Offline
    Monday, September 23 2019, 04:15 PM - #Permalink
    Resolved
    0 votes
    Here is the command's output:
    $ LC_ALL=C ip -4 route
    default via 192.168.1.1 dev enp0s31f6 proto static metric 100
    default via 192.168.1.1 dev p3p1 proto dhcp metric 101
    172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
    192.168.1.0/24 dev enp0s31f6 proto kernel scope link src 192.168.1.2 metric 100
    192.168.1.0/24 dev p3p1 proto kernel scope link src 192.168.1.35 metric 101
    192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1
    192.168.254.0/24 dev virbr1 proto kernel scope link src 192.168.254.1

    The server is working in standalone mode; enp0s31f6 is the external interface to the local network.
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, September 22 2019, 07:50 AM - #Permalink
    Resolved
    0 votes
    It looks like /etc/miniupnpd/init_clearos.sh is failing and not detecting your WAN interface correctly. What is the output of:
    LC_ALL=C ip -4 route


    [edit]
    Also, do you have a LAN interface? it is not being picked up either. If you don't have a LAN interface, there is no point in miniupnpd, but I thought I'd fixed it so it would not give a failure.
    [/edit]
    The reply is currently minimized Show
Your Reply