
1.) Podíváme se jakou máme WAN IP adresu
IP - Addresses
2.) Vytvoříme nové pravidlo do NAT
IP - Firewall - NAT - tlačítko Add
GENERAL:
Chain
= dstnatDst. Address
= naši WAN IP adresuProtocol
= 6 (tcp)Dst. Port
= na jakém portu požadavek zvenku přijdeACTION:
Action
= dst-natTo Addresses
= vnitřní IP zařízeníTo Ports
= na jakém portu zařízení naslouchá3.) Vytvoříme nové pravidlo do Filter Rules
IP - Firewall - Filter Rules - tlačítko Add
GENERAL:
Chain
= forwardProtocol
= 6 (tcp)Dst. Port
= najakém portu požadavek zvenku přijdeIn. Interface
= najakém rozhraní požadavek zvenku přijde (WAN ether)ACTION:
Action
= accept4.) Vyzkoušíme funkčnost
a.) Při diagnostice nějakého problému s přesměrováním portu je vhodné pro začátek sledovat počty paketů procházejících daným pravidlem.
b.) Pokud přesměrování nefunguje a používáte rozdílný port na vstupu a výstupu (jako v příkladu výše), tak nastavte v rámci ověření oba porty schodné a vyzkoušejte chování.
Ukázka Mikrotik - Winbox - Firewall NAT
Ukázka k příkladu výše - přesměrování portu 2222 zvenku na port 5555 uvnitř.


Ukázka Mikrotik - Winbox - Firewall Filter Rule
Ukázka z jiného nastavení - toto se týká povolení (accept) portu 8014 na vstupním rozhraní ether2 přes protokol TCP.


164
MikroTik - port forwarding
Example: We want to set up port forwarding on MikroTik router, when we redirect request to our WAN IP address 8.8.8.8 with port 2222 (from outside) to internal device with IP 192.168.4.106 on port 5555, which is hidden under NAT masquerade .
1.) Let's see what WAN IP address we have
IP Addresses
2.) Create a new NAT rule
IP - Firewall - NAT - Add button
GENERAL:
Chain
= dstnate Dst. Address
= our WAN IP address Protocol
= 7 (tcp) Dst. Port
= on which port the request will come from outsideACTION:
Action
= dst-nat To Addresses
= internal IP device To Ports
= what port the device is listening on3.) Create a new rule in Filter Rules
IP - Firewall - Filter Rules - Add button
GENERAL:
Chain
= forward Protocol
= 7 (tcp) Dst. Port
= any port requests from outside In. Interface
= any interface requests from outside (WAN ether)ACTION:
Action
= accept4.) We'll test the functionality
a.) When diagnosing a port forwarding problem, it is a good idea to start by tracking the number of packets passing through the rule.
b.) If the redirection does not work and you are using a different input / output port (as in the example above), then set both ports to validate and test the behavior.
Mikrotik Sample - Winbox - NAT Firewall
Sample example above - redirect port 2222 from outside to port 5555 inside.


Mikrotik Sample - Winbox - Firewall Filter Rule
Sample from another setting - this applies to accepting port 8014 on the ether2 input interface over TCP.


Verejna ip: 8.8.8.8
Staticka ip DVRka: 10.10.10.10
Port. mob. apky: 37777