Community discussions

MikroTik App
 
IbsCC
just joined
Topic Author
Posts: 4
Joined: Fri Feb 12, 2021 10:44 am

RB750GL - Port Redirect

Fri Feb 12, 2021 10:52 am

Hi everybody,

I am looking for help in configuring this type of redirect rule on the device in question.
I have two devices:
192.168.153.10 - Server
192.168.153.11 - Client
I need to collect from the client some data that the server sends on port 80. Unfortunately I am not able to get them in this port and I would like to redirect them in port 2000.
How can I create a rule so that everything that passes through port 80 is redirected to port 2000 in a bidirectional way?
I created the rule that I attach below but it doesn't seem to work. I don't see any traffic on port 2000.

123.PNG
Rule created:
456.PNG
789.PNG
Can someone help please?
Thanks for your time
You do not have the required permissions to view the files attached to this post.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 6164
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: RB750GL - Port Redirect

Sun Feb 14, 2021 9:38 pm

Im a bit confused so you want port redirect within the same LAN, and not a WAN to LAN port forwarding?
Also, it seems that the Server is initiating communication with the client, is this normal? Or does actually the client initiate the conversation?
If you can explain the requirement more fully without using any configuration terms, ports or IPs etc, but plain english that would be great.

Something like my client likes to put condiments on his toast using a knife but I want him to use the plastic knife whenever he is using Jam.
Put it in terms of what the user needs or what the server needs in plain english.
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!
 
IbsCC
just joined
Topic Author
Posts: 4
Joined: Fri Feb 12, 2021 10:44 am

Re: RB750GL - Port Redirect

Tue Feb 16, 2021 9:21 am

Thanks Anav for your answer,
So i have one device that every minute send in PORT 80 one http post in JSON format (192.168.153.10).
I need to collect this JSON with one device that not accept listening on port 80, so i need to receive that data on PORT 2000.
The 2 devices are on the same LAN connect on 2 different port of the RB750GL.
So what i'm expecting is everything send from device X.10 on port 80 will be redirect on port 2000. The opposite for the device X.11 that will answer on port 2000 and those packets will be redirect on port 80.
Is this possible?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 6164
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: RB750GL - Port Redirect

Tue Feb 16, 2021 4:31 pm

Okay, so that I understand.
You have a device that sends data OUTwards on port 80 but to where? Not sure of this functionality? Is it a multicast ???
This output is sent via ethernet?

You have another device that is capable of accepting these types of outputs but not on Port 80 but can on Port 2000.
This device also replies to the initial traffic inbound, also on port 2000 back to the original device but needs to be translated back on port 80 as the original device is listening on port 80.

What I do know is that the MT router is extremely flexible so that once the requirement is well understood some genius in here (Sindy, or MKX etc) will be able to figure out a solution.
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!
 
IbsCC
just joined
Topic Author
Posts: 4
Joined: Fri Feb 12, 2021 10:44 am

Re: RB750GL - Port Redirect

Tue Feb 16, 2021 4:47 pm

Ok i go deeper,
This device able to send HTTP POST on Port 80 was originary connect in internet.
Once connect in internet it was looking for the name server (example) cloud.miktorik.com.
The cloud of the producer was ended the first February of this year so i have think to collect this data instead sending the data in one cloud that is definitely out of network.

So now i take my mikrotik and i create a static DNS where cloud.mikrotik.com is the IP of the device able to receive on port 2000.
Once i connect the device to the mikrotik the name server is resolved and the device start to send the HTTP post to the device set as static DNS.
Now i want to bend this HTTP POST from port 80 to port 2000 to be able to listen it and collect datas.

Please let me know if make sense
 
IbsCC
just joined
Topic Author
Posts: 4
Joined: Fri Feb 12, 2021 10:44 am

Re: RB750GL - Port Redirect

Thu Feb 18, 2021 10:15 am

Sorry guys to up this topic,
Someone have any suggestion?
 
tdw
Forum Veteran
Forum Veteran
Posts: 710
Joined: Sat May 05, 2018 11:55 am

Re: RB750GL - Port Redirect

Thu Feb 18, 2021 1:08 pm

As the source and destination addresses are within the same subnet you need to disable any bridge hardware offload and set use-ip-firewall=yes under /interface bridge settings as normally the IP firewall filter/NAT/mangle rules only apply to routed layer 3, not bridged layer 2 traffic. This does increase processing required, so may not be the best method if the Mikrotik is doing other things as well.

Also, the NAT action redirect directs traffic to a local address on the Mikrotik itself, the action should be dst-nat. The dst-address parameter on the general tab is to match the traffic to which the rule should apply, not where to direct it to, that is to-address on the action tab.

Who is online

Users browsing this forum: Bing [Bot], eworm, Google [Bot], JotaOS, nichky, sindy and 221 guests