Think Like a Computer
No ads, no affiliate links, no software recommendations you did not ask for.

What UPnP Does on a Network

UPnP lets a LAN device ask the router to open a port mapping without authentication. What the IGD protocol does, why consoles use it, and the real risks.

A router performing network address translation rewrites outgoing packets so that many devices can share one public address. The same translation is what makes an inbound connection impossible: a packet arriving from the internet carries no record of which internal machine should receive it, so the router has nothing to forward it to. Something has to create that record in advance. UPnP exists so that the device wanting the inbound connection can create it itself, by asking the router over the local network, without a person logging into the router’s administration page.

The Internet Gateway Device profile and what it actually does

UPnP is a family of protocols for discovering and controlling devices on a local network. The part that matters for connectivity is the Internet Gateway Device profile, usually shortened to IGD. A router that implements IGD advertises itself on the LAN using SSDP, a discovery protocol carried over multicast UDP on port 1900. A client that wants an inbound port sends an SSDP search, receives the router’s description document over HTTP, and then calls the router’s control endpoint with a SOAP action. The action that opens a mapping is AddPortMapping. It carries the external port, the internal port, the internal client address, the protocol, and a lease duration. DeletePortMapping removes it, and GetExternalIPAddress returns the public address the router holds.

None of those calls require a username, a password, or any proof that the caller is entitled to the mapping. The router trusts the request because it arrived on the LAN interface. That design choice is the whole point and the whole problem: the mechanism is convenient precisely because it has no authentication step.

A mapping created this way appears in the router’s NAT table exactly as a manually configured forward would. It survives until its lease expires, until the requesting application deletes it, or until the router reboots and loses the table.

Why consoles and voice applications depend on it

A game console or a voice-over-IP client needs to receive inbound packets on a port it did not choose in advance, and it needs this to work on whatever network it is plugged into. Manual forwarding requires a person who knows the router’s address, its login, and the console’s current LAN address, and that person has to redo the work whenever the console’s address changes. UPnP removes all of that. The console asks, the router opens the mapping, and the session works.

The dependency is real rather than cosmetic. When UPnP is disabled and no manual forward exists, the console or voice client can still make outbound connections, so menus and downloads work, but inbound traffic from peers cannot reach it. On a console this shows up as a strict or moderate NAT type and as matchmaking that fails or connects only to a subset of players. The mechanism explains the symptom: the router has no mapping, so the peer’s packets are dropped at the translation step.

What goes wrong when UPnP is reachable from the WAN side

The risk that gets discussed most is malware. A program running on any machine on the LAN can call AddPortMapping just as a game console can. Malware that does so can expose an internal service to the internet without any user action and without leaving a visible configuration change in the router’s web interface, because the mapping lives only in the NAT table. The defence is not to audit every mapping but to keep the LAN free of untrusted code and to notice unexpected open ports.

The more serious configuration fault is a router that accepts UPnP requests on its WAN interface. When that happens, any host on the internet can send AddPortMapping to the router’s public address and open a hole into the LAN. This is a router firmware setting, usually labelled something like “allow UPnP on WAN” or “enable UPnP over the internet”, and it should be off. The IGD protocol was designed for the LAN side; exposing it to the internet removes the only boundary the design relied on.

A third fault is a router that honours AddPortMapping requests naming an internal address other than the caller’s own. A correct implementation binds the mapping to the source address of the request. A router that does not allows one LAN device to redirect traffic intended for another, which is a useful primitive for an attacker already inside the network.

NAT-PMP and PCP as the later alternatives

Apple defined NAT Port Mapping Protocol, NAT-PMP, as a lighter replacement for the port-mapping part of IGD. It runs over UDP port 5351, uses a compact binary request rather than SOAP, and supports mapping requests and deletion. It does not carry the device-discovery and description machinery of UPnP, because it was never intended to do anything but port mapping.

Port Control Protocol, PCP, is the IETF successor to NAT-PMP and is specified to coexist with it on the same port. PCP adds address-family independence, so it can request mappings for IPv4 and IPv6, and it supports explicit lifetime and precedence values. A router may implement UPnP IGD, NAT-PMP, PCP, or some combination. A client that finds no IGD may still succeed through NAT-PMP or PCP, which is why a console can report an open NAT on a router whose UPnP setting is off but whose NAT-PMP setting is on.

Manual port forwarding as the alternative

Manual forwarding does the same thing as AddPortMapping with one difference: a person decides the mapping and it persists until that person removes it. The trade is control against convenience. The reader needs the internal address of the device, which should be made static first, either by a DHCP reservation on the router or by a fixed address on the device; a forward pointed at an address that DHCP later reassigns sends traffic to the wrong machine. The router’s administration page then takes an external port, an internal address, an internal port, and a protocol.

Manual forwarding is the correct choice when UPnP must be disabled for policy reasons, when the router’s UPnP implementation is known to be faulty, or when the mapping must survive a reboot. It is the wrong choice when devices come and go, because each one needs its own forward and its own reservation. The steps for a specific router and console combination are covered in the port-forwarding and open-NAT guides linked from this cluster.

Deciding whether to leave UPnP enabled

The decision turns on what the network contains and what the router does with the protocol. UPnP on the LAN side, with WAN-side UPnP off and firmware that binds mappings to the requesting address, is the configuration the protocol was designed for, and disabling it costs the convenience described above. UPnP reachable from the WAN side is a fault regardless of what else is configured.

SituationUPnP usefulUPnP not the right answer
Console or voice client behind NAT, no fixed portsYes; the device opens its own mapping—
Server with a known service and a static address—Manual forward; the mapping should persist and be auditable
Router firmware exposes UPnP on the WAN interface—Disable WAN-side UPnP first; the LAN setting is secondary
Network with untrusted devices on the same LAN—Manual forwards only; any LAN host can call AddPortMapping
Router implements NAT-PMP or PCP but not IGDYes, through those protocols—

Checking what a router has opened

Most router administration pages list active NAT mappings, sometimes under a heading such as “UPnP”, “Port Forwarding”, or “NAT table”. A mapping the reader did not create, pointing at an internal address that does not correspond to a known device, is the visible sign of the malware case described above. Removing it from that page and then identifying the program that created it is the repair; the mapping itself is only a symptom.

On the Windows side, the Get-NetNatStaticMapping cmdlet reports static mappings on a Windows host acting as a NAT gateway, not mappings on a separate router, so it will return nothing on an ordinary home network. The router’s own page is the place to look.

A quick way to see whether a port is reachable from outside is to compare the router’s reported external address with the address a public service sees. If the router reports a private address such as 100.64.x.x or 10.x.x.x as its external address, the network is behind another layer of translation, and no UPnP mapping on the inner router will make the port reachable from the internet. That condition is carrier-grade NAT, and it explains a console that stays strict no matter what the UPnP setting says.

Common questions

what is UPnP in simple terms

It is a set of protocols that lets devices on a local network find each other and control each other without configuration. The part that affects connectivity is the Internet Gateway Device profile, which lets a device ask the router to open a port so inbound traffic can reach it.

should I enable UPnP on my router

Enable it on the LAN side if consoles or voice apps need inbound connections and no manual forward exists. Make sure the router does not accept UPnP requests on its WAN interface, and keep the firmware current. If the network holds devices that cannot be trusted, manual forwarding is the safer choice.

does UPnP do port forwarding

Yes. A device calls the router's AddPortMapping action, and the router creates a NAT mapping equivalent to a manual forward. The mapping is temporary and is removed when its lease expires, when the application deletes it, or when the router reboots.

is UPnP a security risk

Two risks are real. Malware on the LAN can open a port without user action, and a router that accepts UPnP on the WAN interface lets any internet host open a mapping. A correctly configured router with WAN-side UPnP off limits the exposure to code already running inside the network.

why does my console still show strict NAT with UPnP on

The router may not implement IGD, may have the setting off in a second place, or may sit behind another layer of translation such as carrier-grade NAT. Compare the router's reported external address with the address a public service sees; a private or 100.64.x.x address means the inner router's mappings cannot be reached from the internet.

Read next