Skip to content
MikroTik RouterOS Docs

UPnP Configuration

For the impatient: enable UPnP for automatic port forwarding on your LAN.

/ip upnp set enabled=yes allow-disable-external-interface=no
/ip upnp interfaces add interface=ether1 type=external
/ip upnp interfaces add interface=bridge type=internal

Verify with:

/ip upnp interfaces print

What this does: UPnP (Universal Plug and Play) allows applications on your network to automatically request port forwarding without manual configuration. When a device requests a port mapping, RouterOS creates dynamic NAT rules to forward traffic.

When to use this:

  • Gaming consoles (Xbox, PlayStation) requiring open NAT
  • Voice and video applications (Skype, Discord)
  • Peer-to-peer applications (BitTorrent, file sharing)
  • Smart home devices needing external access
  • Any application requiring inbound connections from the internet

Prerequisites:

  • WAN interface with public IP address (or forwarded by upstream router)
  • LAN interface where UPnP clients connect
  • Applications that support UPnP/IGD protocol

Enable UPnP and disable the security risk of external interface control.

/ip upnp set enabled=yes allow-disable-external-interface=no

Configure your WAN interface as the external UPnP interface.

/ip upnp interfaces add interface=ether1 type=external

Configure your LAN interface as the internal UPnP interface.

/ip upnp interfaces add interface=bridge type=internal

Check that both interfaces are configured correctly.

/ip upnp interfaces print

Expected output:

Flags: X - disabled
# INTERFACE TYPE FORCED-EXTERNAL-IP
0 ether1 external
1 bridge internal

From a client device, use an application that requests UPnP port mapping. Check created rules:

/ip firewall nat print where comment~"upnp"

For Xbox or PlayStation requiring “Open NAT” status:

/ip upnp set enabled=yes allow-disable-external-interface=no
/ip upnp interfaces add interface=ether1 type=external
/ip upnp interfaces add interface=bridge type=internal

The console will automatically request needed ports for online gaming and voice chat.

When LAN clients are on a VLAN, specify the VLAN interface:

/ip upnp interfaces add interface=vlan100 type=internal

Do not use the parent interface; use the VLAN interface directly.

Add multiple internal interfaces for different network segments:

/ip upnp interfaces add interface=bridge-lan type=internal
/ip upnp interfaces add interface=bridge-guest type=internal

When your WAN interface has multiple IP addresses, specify which one UPnP should use:

/ip upnp interfaces set [find type=external] forced-external-ip=203.0.113.10

Check which ports have been dynamically mapped:

/ip firewall nat print where comment~"upnp"

Example output:

5 D chain=dstnat action=dst-nat to-addresses=192.168.1.50 to-ports=3074
protocol=udp dst-port=3074 comment="upnp Xbox"

If you prefer manual port forwarding only:

/ip upnp set enabled=no
/ip upnp print

Expected: Shows enabled: yes.

/ip upnp interfaces print

Expected: Both external and internal interfaces listed.

/ip firewall nat print where dynamic

Expected: UPnP-created rules appear when clients request mappings.

SymptomCauseSolution
UPnP requests failUPnP not enabledEnable: /ip upnp set enabled=yes
No port mappings createdWrong interface typeVerify external=WAN, internal=LAN interfaces
VLAN clients can’t use UPnPParent interface usedSpecify VLAN interface, not parent
Port 80/443/22 mapping failsPorts in use by routerError 729; these ports conflict with router services
”ConflictWithOtherMechanisms” errorStatic NAT rule existsRemove conflicting static rules or accept that manual rules take precedence
UPnP rules don’t workRules placed after static rulesUPnP rules are dynamic; static rules above them take precedence
Gaming still shows “Moderate NAT”Multiple NAT (double NAT)Ensure only one router does NAT; check ISP modem
Mappings disappearLease expired or rebootNormal behavior; applications re-request mappings

Security Considerations

  • Always set allow-disable-external-interface=no - Otherwise any LAN user can disable your WAN interface
  • UPnP has no authentication - Any device on your LAN can request port mappings
  • Consider the security trade-off - UPnP convenience vs. potential for malware to open ports
  • Monitor active mappings - Regularly check /ip firewall nat print where dynamic
  • Isolate IoT devices - Use separate VLAN without UPnP for untrusted devices
PropertyTypeDefaultDescription
enabledyes/nonoEnable UPnP service
allow-disable-external-interfaceyes/noyesAllow clients to disable WAN (security risk!)
show-dummy-ruleyes/noyesShow placeholder rule in NAT table
PropertyTypeDefaultDescription
interfacestring-Interface name
typeexternal/internal-Interface role (WAN or LAN)
forced-external-ipIP address-Force specific IP for mappings
CommandDescription
/ip upnp setConfigure UPnP settings
/ip upnp printShow UPnP configuration
/ip upnp interfaces addAdd UPnP interface
/ip upnp interfaces printShow configured interfaces
/ip upnp interfaces removeRemove UPnP interface
/ip firewall nat print where dynamicView UPnP-created NAT rules