Community discussions

MikroTik App
 
waajoo
just joined
Topic Author
Posts: 1
Joined: Sun Jan 01, 2023 11:10 pm

Basic local forwarding question

Sun Jan 01, 2023 11:17 pm

Hi,

So I have what I thought is an easy question but I can't find an answer that has helped me so far.

Let's say I have a local dns server on port 32733 on a local client 192.168.1.10.
How can I direct my clients here?
What firewall rule do I need to redirect traffic arriving at 192.168.1.10:53 to 192.168.1.10:32733?

All this is only local in the network.
Thank you very much in advance :)
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19323
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Basic local forwarding question

Mon Jan 02, 2023 4:02 am

If you are in the same subnet, then you have two options...

a. give the users the IP address and they plug it in themselves into whatever application they are using IPaddress:port#
b. give them the WANIP address of the router to use WANIPaddress:port#

If you are using method b. then because the users and server are on the same subnet we run across loopback or hairpin nat.
To solve this typically one creates an additional sourcenat rule
Typically:
add chain=srcnat action=masquerade dst-address=192.168.1.0/24 src-address=192.168.1.0/24
add chain=srcnat action=masquerade out-interface-list=WAN


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Okay I misread the question, you wanted to know about port translation which is done on the destination nat rule.

add action=dst-nat chain=dstnat in-interface-list=WAN dst-port=53 protocol=tcp to-addresses=192.168.1.10 to-ports=32733

That would work in some cases. The format of the rule is determined by who is connection and from where as I alluded to above and also if your WANIP is dynamic or static.
Without more info, cannot advise further. By the way assuming your use of 53 is not for real as that is DNS port.

Who is online

Users browsing this forum: Bing [Bot], ecks0fa, vk2mpj and 38 guests