1*4882a593Smuzhiyun[Unit] 2*4882a593SmuzhiyunDescription=UPnP Internet Gateway Device version 2 daemon 3*4882a593SmuzhiyunAfter=network.target 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun[Service] 6*4882a593SmuzhiyunEnvironment="LAN=eth0" 7*4882a593SmuzhiyunEnvironment="WAN=eth0" 8*4882a593SmuzhiyunEnvironmentFile=/etc/default/upnpd 9*4882a593Smuzhiyun# For the UPnP library to function correctly, networking must be configured 10*4882a593Smuzhiyun# properly for multicasting as described in 11*4882a593Smuzhiyun# https://sourceforge.net/p/pupnp/code/ci/master/tree/README. 12*4882a593Smuzhiyun# Without this addition, device advertisements and control point searches will 13*4882a593Smuzhiyun# not function. 14*4882a593Smuzhiyun# However, the route has to be configured once for all UPnP applications 15*4882a593Smuzhiyun# (igd2-for-linux, ushare, ...) so do not manage UPnP route by default 16*4882a593Smuzhiyun#ExecStartPre=/sbin/route add -net 239.0.0.0 netmask 255.0.0.0 $LAN 17*4882a593Smuzhiyun#ExecStopPost=/sbin/route del -net 239.0.0.0 netmask 255.0.0.0 $LAN 18*4882a593SmuzhiyunExecStart=/usr/sbin/upnpd -f $WAN $LAN 19*4882a593SmuzhiyunRestart=always 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun[Install] 22*4882a593SmuzhiyunWantedBy=multi-user.target 23