[systemd-devel] Enable port forwarding via upnp

Kai Krakow hurikhan77 at gmail.com
Tue Feb 24 23:16:48 PST 2015


Hello!

Is it possible to somehow create a service which enables port forwardings on 
my router using upnp? Currently, I guess it is not possible (except maybe 
using ExecPost or ExecPre and the upnpc program). But when my client IP 
changes via DHCP, it should be reapplied. Also, it needs to be maintained as 
the programmed port forwardings would timeout and be cleared from the router 
after a while. So it needs to be hooked up to systemd-networkd somehow (at 
least that is what I am using).

So I guess this logic should be built into systemd-networkd, maybe offering 
some dbus interface also. And service and/or socket files could have a flag 
to enable upnp forwards. This way, systemd-networkd knows about the 
registered forwards and maintains them, and systemd will trigger 
registration/unregistration on it whenever services start or stop which have 
such flags enabled. By using dbus, this could be an interface implemented by 
other network management daemons, too.

Is this the way to go? I may be willing to help implementing a patch for 
this, though I am absolutely not familiar with dbus programming and the 
security measures involved.

I just wanted to ask first, if it makes sense at all - or if there's already 
a way to do it by creating a combination of timer and service units which 
are triggered by systemd-networkd events somehow.

Please advice and tell your thoughts. Maybe it is just plain insane...

-- 
Replies to list only preferred.



More information about the systemd-devel mailing list