[olug] UPnP on a Linux box

Eric W. Biederman ebiederm at xmission.com
Fri Jan 2 13:21:34 CST 2015


Kevin <sharpestmarble at gmail.com> writes:

> Hello all,
>
> I am trying to get UPnP to work on my linux router. Normal people will have
> a linksys or a dlink box acting as their router; I have a CentOS 6.4 box.
> My clients behind the router are having problems(Android Device Manager
> can't locate them when connected to the wifi for which the CentOS box is
> the router, Google Hangouts will work only when I enter that Hangout); I
> suspect that it's because their UPnP commands don't work. If I connect them
> to my 3G hotspot, everything works fine and dandy. So I'm trying to get
> UPnP to work, but no commands I've done would have set up UPnP, to my
> knowledge.
>
> I've done some searching and have found
> https://gitorious.org/igd2-for-linux/ this page as the most promising, but
> the most recent update is from Feb 2013 and I'd have to work from source.
> While I can do so, I'd prefer something both more recent and with
> pre-compiled binaries.
>
> So does anyone know of pointers to get UPnP working?
>
> Here's what I've done in a nutshell to get the routing working:
> echo 1 > /proc/sys/net/ipv4/ip_forward
> iptables -t nat -I POSTROUTING -o eth3 -j MASQUERADE #eth3 is my WAN interface.

I think that is missing a rule iptables rule in for other direction.
Something like:

  iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT


Openwrt and most of the linux based home routers use miniupnpd
http://miniupnp.free.fr/ That might be worth looking at.

Eric


More information about the OLUG mailing list