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