Community discussions

MikroTik App
 
StonePlex
just joined
Topic Author
Posts: 1
Joined: Mon Mar 23, 2020 12:32 pm

How to portforward for Minecraft server

Mon Mar 23, 2020 12:46 pm

Hi! I have been trying to portforward for my minecraft server but, I can't get it to work. I am a noob when it comes to these things so I need help. I have tried multiple solutions with the GUI or the terminal solutions, but they don't seem to work. Here are some of the commands I tried.
ip firewall filter add chain=forward dst-address=192.168.88.142 protocol=tcp dst-port=25565 action=accept

/ip firewall nat add chain=dstnat protocol=tcp dst-port=25565 in-interface=wlan1 action=dst-nat to-address=192.168.88.142 to-ports=25565 

/ip firewall nat
	add chain=dstnat action=dst-nat dst-port=25565 protocol=tcp in-interface=wlan1 \
	to-address=192.168.88.142 to-ports=25565


I can't get it to work. It works localy, but thats it.
I have tried to disable the Firewall itself, but my router doesn't allow it.
/ip firewall filter disable [/ip firewall filter find]
I get an error: failiure: cannot change builtin

Need help. I am open to any solution.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 5705
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: How to portforward for Minecraft server

Mon Mar 23, 2020 2:52 pm

Yes,
1. Only one firewall rule is needed for port forwarding (whether you have one server or 20 - assuming NAT of course)
2. You need one dstnat rule per server.

1. If you still have the default firewall rule in place............. it will work just fine.
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN



2. For the destination nat rule..... I am confused by wlan1 but will assume you have your INTERNET coming on on WLAN1? In any case Try
add chain=dstnat action=dst-nat protocol=tcp dst-port=25565 in-interface=WAN to-address=192.168.88.142

dont need to-ports if no change from dst-port.
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!
 
hahnhell
Frequent Visitor
Frequent Visitor
Posts: 60
Joined: Sat Mar 07, 2020 11:49 pm
Location: NCR, Canada

Re: How to portforward for Minecraft server

Sat Nov 21, 2020 4:03 am

I know this is a bit of a hijack, but i'm trying to do the exact same thing here... My port forwarding attempts don't seem to be working either.

I've tried in the past, have had a complete redo of my network layout, and I still can't seem to get it working.

@anav, i'm willing to take the time to learn this one and debug it completely.. The kids and their minecraft is not as important as it was to get their school work up and going!

I've done this exact same thing, trying to get to my server (192.168.15.10) same port. Nada. :(

I'm using the Mikrotik cloud service. When I go to the address, I end up seeing my router homepage (login page). But I can't seem to get 25565 to work.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 5705
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: How to portforward for Minecraft server

Sat Nov 21, 2020 5:03 am

No worries, post your config for me to look at.
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!
 
NevadaNV
just joined
Posts: 1
Joined: Sun Nov 22, 2020 6:47 pm

Re: How to portforward for Minecraft server

Sun Nov 22, 2020 6:55 pm

No worries, post your config for me to look at.
Hi! I am experiencing exact the same problem, I've done everything and still canyouseeme.org can't see my 25565 port.
I've done
/ip firewall nat add chain=dstnat protocol=tcp dst-port=25565 in-interface=sfp1 action=dst-nat to-address=192.168.88.100 to-ports=25565
and
/ip firewall filter add chain=forward dst-address=192.168.88.100 protocol=tcp dst-port=25575 action=accept
I also placed them on top of other rules, opened the 25565 port on my server and called my ISP support to see whether they blocked any ports, they didnt. Still nothing. Any ideas on what else I could do?
 
hahnhell
Frequent Visitor
Frequent Visitor
Posts: 60
Joined: Sat Mar 07, 2020 11:49 pm
Location: NCR, Canada

Re: How to portforward for Minecraft server

Wed Nov 25, 2020 10:32 pm

Sorry, I forgot to subscribe to this thread and was just waiting to see it hit my inbox... fail!

Here's my config..
You do not have the required permissions to view the files attached to this post.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 5705
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: How to portforward for Minecraft server

Thu Nov 26, 2020 12:22 am

Hmmm,
Only thing in firewall rules to clarify is that your IOT devices are not included in list internet and thus cannot access the internet.
All my IOT devices need to talk to the internet cloud of some sort???

The firewall rule for port forwarding is the default one so it looks okay but needs to be refined!
The second last rules in the forward chain could be cleaned up as its slightly redundant due to the more encompassing last rule> The idea here is to state what traffic you are allowing......
From
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN

add action=drop chain=forward comment="drop all else"

TO
add action=accept chain=forward comment="allow port forwarding" \
connection-nat-state=dstnat connection-state=new in-interface-list=WAN
add action=drop chain=forward comment="drop all else"

As far as port forwarding.......
add action=dst-nat chain=dstnat comment="Minecraft Server" dst-port=25565 \
in-interface=PPPoE_WAN protocol=tcp to-addresses=192.168.15.10


Hmmm try
in-interface-list=WAN to see if that help?
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 5705
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: How to portforward for Minecraft server

Thu Nov 26, 2020 12:28 am

Just to confirm,

You are trying to reach the servers via the WANIP??
WHY............. just use the lanip of the server??

If the server is in the same LANIP of the user and trying to reach it via WANIP of the router then that is called hairpin NAT>
The easiest solution is to move the server to another vlan by itself and that will solve that for example or you need to make more rules in IP NAT.

Alternatively you can get a friend to see if they can get at the server from their WANIP, as hairpin nat or often called loopback is a local phenomena.
What functionality do you want to have??
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!
 
hahnhell
Frequent Visitor
Frequent Visitor
Posts: 60
Joined: Sat Mar 07, 2020 11:49 pm
Location: NCR, Canada

Re: How to portforward for Minecraft server

Thu Nov 26, 2020 1:37 am

I'm trying to port forward this so that I can connect to it from outside my network.

I am using the lanIP for the devices inside the network, that works just fine. I want to be able to invite others to it is the issue.
 
hahnhell
Frequent Visitor
Frequent Visitor
Posts: 60
Joined: Sat Mar 07, 2020 11:49 pm
Location: NCR, Canada

Re: How to portforward for Minecraft server

Thu Nov 26, 2020 1:46 am

And, now that I changed that second to last rule, it seems to be working.

Thank you very much @anav! Have a good one.

Who is online

Users browsing this forum: aesmith and 38 guests