Firewalling UPnP

The UPnP server does not require, and should not be allowed any access to or from any network other than the internal client network. For UPnP to operate, your firewall must allow the following:

Table 12.1. Firewall passthroughs

Protocol/PortDestinationRemarks
UDP 1900fw to/from localSSDP announcements
TCP 49152fw from localHTTP/XML mini-server
TCP any portfw to localHTTP/XML queries of other UPnP devices
UDP any portfw to localrespond to remote SSDP requests

Additionally, both UPnP on the router and on your control-point clients generate SSDP packets which are multicast to 239.255.255.250. Both also send and listen to IGMP join messages on 224.0.0.22. You must have a route covering these multicast groups pointing towards your internal network or the announcements will be sent towards your default route, which is almost always not what you want. The UPnP wrapper scripts provided in this package will set up a multicast route for you, or you can specify what you want in /etc/default/upnpd.

When a client requests NAT traversal, rules will be created in the forwardUPnP FORWARDING table and UPnP PREROUTING table. This is not the default behavior for UPnP -- it normally writes directly to FORWARDING and PREROUTING.

Important

If you are not integrating with Shorewall as described in this document, you will want to change the configuration in /etc/upnpd.conf.