UPnP: Redirect The Port To Mikrotik Device - MikroTik Script RouterOS
A common question for home users is How to redirect the port to MikroTik device, for the games and programs to work correctly.
The easiest option is to enable UPnP for devices on your home network. Most programs and games have UPnP support, but in some (Torrent) it must be enabled in the settings.
Port Forwarding (MikroTik UPnP)
Enable UPnP support in MikroTik:
[IP] -> [UPnP] -> [UPnP Settings: Enabled, Show Dummy Rules]
In the UPnP settings window, specify the external and internal interfaces of the router.
After enabling UPnP and the Show Dummy Rules item in the Firewall window, you will see the automatic port forwarding rules.
How to forward port on your router using UPnP
Port forwarding (MikroTik Firewall)
An example is shown for the Torrent client:
Torrent port: 50237;
Torrent protocol: UDP;
Computer IP address: 192.168.2.9;
Incoming interface (Internet): beeline;
Internal interface (local network): bridge1-lan.
Create a Firewall rule manually:
[IP] -> [Firewall] -> [NAT] -> [+] -> [General: Chain=dstnat, Protocol=17(udp), Dst.Port=50237, In.Interface=beeline] -> [Action: Action=netmap, To Addresses=192.168.2.9, Port=50237]
Let’s create a Firewall rule via the terminal:
/ip firewall nat add chain=dstnat protocol=udp dst-port=50237 in-interface=beeline action=netmap to-addresses=192.168.2.9 to-ports=50237
How to forward port on your router using Firewall rules
How to set up port forwarding on a MikroTik router was discussed in this article. I hope now setting up port forwarding will not be difficult and programs and games will work as expected, use UPnP if possible. However, if you run into any problems while setting up, feel free to write in the comments. I will try to help.