Community discussions

MikroTik App
 
HDArtworks
just joined
Topic Author
Posts: 6
Joined: Wed Feb 15, 2017 5:07 pm

How to do port forwarding for online game

Wed Feb 15, 2017 5:18 pm

Hi, everyone. I know this question asked a lot.

But I really confused.

I have access to my MikroTik with winbox and I want to open this port(UDP 32303). This port is for an online game called theHunter. I can't play Multiplayer and mods told me you have to do port forwarding.

How can I do that? And is that necessary to set a static IP? If yes, How?

Thanks a lot,
Hossein.
 
janus20
Member Candidate
Member Candidate
Posts: 108
Joined: Thu Nov 03, 2016 10:31 am
Location: Pitesti, Romania

Re: How to do port forwarding for online game

Wed Feb 15, 2017 11:42 pm

Hi,

Without any knowledge about your config you could give a try to this:
/ip firewall nat
add action=src-nat chain=srcnat dst-address={your_wk_lan_ip} dst-port=32303 protocol=udp comment="UDP 32303 theHunter"
*dst-address={your_wk_lan_ip} - here put your workstation internal lan ip ( Ex.: 192.168.1.20 )
kind regards,
 
Revelation
Member
Member
Posts: 336
Joined: Fri Dec 25, 2015 5:59 am

Re: How to do port forwarding for online game

Thu Feb 16, 2017 4:02 pm

You will need to configure a dst-nat for inbound traffic. It is recommend that you use a static IP on your PC or at least set a DHCP reservation so your PC pulls the same IP address every time.

It should look something like:
chain=dstnat action=dst-nat in-interface=(put your WAN interface here) dst-port=(Ports Needed for Game/Service) to-addresses=(your LAN IP address here) to-ports=(Ports Needed for Game/Service) protocol=tcp 
You can also use "dst-ip=WAN IP" instead of "in-interface"

***EDIT***
As far as setting a Static IP or a DHCP reservation...

Static IP can be configured on your PC. A reservation can be done if you go into "DHCP Server" on your Mikrotik, then select "Leases" and locate your PC. Right-click and select "make static."
 
HDArtworks
just joined
Topic Author
Posts: 6
Joined: Wed Feb 15, 2017 5:07 pm

Re: How to do port forwarding for online game

Sat Feb 18, 2017 12:33 pm

Thanks for the answer, guys. Really appreciate it.
How about a port number range?
I want to open port for World of Tanks game.
10501 & 10502 TCP and 8251 UDP.
Should I create new rule for each port?
As far as setting a Static IP or a DHCP reservation...

Static IP can be configured on your PC. A reservation can be done if you go into "DHCP Server" on your Mikrotik, then select "Leases" and locate your PC. Right-click and select "make static."
Thanks, Revelation.
Make IP static from DHCP Server on MikroTik doesn't kill my internet? I'm not a pro and I'm afraid to do something wrong!
 
Revelation
Member
Member
Posts: 336
Joined: Fri Dec 25, 2015 5:59 am

Re: How to do port forwarding for online game

Sun Feb 19, 2017 3:38 am

Thanks for the answer, guys. Really appreciate it.
How about a port number range?
I want to open port for World of Tanks game.
10501 & 10502 TCP and 8251 UDP.
Should I create new rule for each port?
Port ranges are possible, though I typically do individual ones.
Thanks, Revelation.
Make IP static from DHCP Server on MikroTik doesn't kill my internet? I'm not a pro and I'm afraid to do something wrong!
No, it won't kill your internet. On your Mikrotik, setting a reservation, "static" option, will simply tell the router to assign a specific IP address to the same device every time it "checks in." It will also not assign it to any other device. What this means is you don't have to go back and change the "to ip address" from time to time.
 
HDArtworks
just joined
Topic Author
Posts: 6
Joined: Wed Feb 15, 2017 5:07 pm

Re: How to do port forwarding for online game

Sun Feb 19, 2017 6:52 am

Thanks.
I change my IP to static.
I confused a little bit!
LAN IP address = My static IP address, Right?

And I try to run the command and it says "syntax error (line 1 column 6)".
 
Revelation
Member
Member
Posts: 336
Joined: Fri Dec 25, 2015 5:59 am

Re: How to do port forwarding for online game

Sun Feb 19, 2017 5:59 pm

Thanks.
I change my IP to static.
I confused a little bit!
LAN IP address = My static IP address, Right?

And I try to run the command and it says "syntax error (line 1 column 6)".
What are you talking about?
 
HDArtworks
just joined
Topic Author
Posts: 6
Joined: Wed Feb 15, 2017 5:07 pm

Re: How to do port forwarding for online game

Sun Feb 19, 2017 6:28 pm

What are you talking about?
I open a new terminal and run this code with the port and my IP:
chain=dstnat action=dst-nat in-interface=(put your WAN interface here) dst-port=(Ports Needed for Game/Service) to-addresses=(your LAN IP address here) to-ports=(Ports Needed for Game/Service) protocol=tcp 
But I got this error:
syntax error (line 1 column 6)
 
Revelation
Member
Member
Posts: 336
Joined: Fri Dec 25, 2015 5:59 am

Re: How to do port forwarding for online game

Sun Feb 19, 2017 6:44 pm

What are you talking about?
I open a new terminal and run this code with the port and my IP:
chain=dstnat action=dst-nat in-interface=(put your WAN interface here) dst-port=(Ports Needed for Game/Service) to-addresses=(your LAN IP address here) to-ports=(Ports Needed for Game/Service) protocol=tcp 
But I got this error:
syntax error (line 1 column 6)
You need to type out the exact code you tried to put in.
 
janus20
Member Candidate
Member Candidate
Posts: 108
Joined: Thu Nov 03, 2016 10:31 am
Location: Pitesti, Romania

Re: How to do port forwarding for online game

Sun Feb 19, 2017 7:33 pm

Hi,

Let's suppose your WAN interface is ether1 and your PC lan ip address is 192.168.1.100. I think that what Revelation wants to say is that you should issue following command into "New Terminal"
for 10501-10502 tcp
/ip firewall nat
chain=dstnat action=dst-nat in-interface=ether1 dst-port=10501-10502 to-addresses=192.168.1.100 to-ports=10501-10502 protocol=tcp 
and 8251 udp
/ip firewall nat
chain=dstnat action=dst-nat in-interface=ether1 dst-port=8251 to-addresses=192.168.1.100 to-ports=8251 protocol=udp 
kind regards,
 
HDArtworks
just joined
Topic Author
Posts: 6
Joined: Wed Feb 15, 2017 5:07 pm

Re: How to do port forwarding for online game

Sun Feb 19, 2017 10:29 pm

Thanks for the answer.
I copy the command on this thread and change the in-interface and to-ports and to-address with mine. But I get the error.

I tried to type the command but after I write "chain" the text color change to red. And after I put "=", background text of "=" symbol change to red. After I launch the command I get the error.

"line 1 column 6" told me that "=" after chain has an problem.
 
janus20
Member Candidate
Member Candidate
Posts: 108
Joined: Thu Nov 03, 2016 10:31 am
Location: Pitesti, Romania

Re: How to do port forwarding for online game

Sun Feb 19, 2017 10:42 pm

Hi,

Sorry i was not pay attention too. Both commands have a typo meaning is mising "add" in front of them.
Corrent syntax:
/ip firewall nat
add chain=dstnat action=dst-nat in-interface=ether1 dst-port=10501-10502 to-addresses=192.168.1.100 to-ports=10501-10502 protocol=tcp 
and
/ip firewall nat
add chain=dstnat action=dst-nat in-interface=ether1 dst-port=8251 to-addresses=192.168.1.100 to-ports=8251 protocol=udp 
kind regards,
 
HDArtworks
just joined
Topic Author
Posts: 6
Joined: Wed Feb 15, 2017 5:07 pm

Re: How to do port forwarding for online game

Tue Feb 21, 2017 9:29 pm

Thank you so much everyone.

Finally I open some ports. :)

Really appreciate it.