Community discussions

 
BennyB
just joined
Topic Author
Posts: 3
Joined: Wed Jul 17, 2019 5:14 pm

Redirecting to another port

Wed Jul 17, 2019 5:37 pm

Hello guys,

I need a little help on redirecting traffic to another port.

The case is:

I have a machine controller which I want to connect to a printer. The machine controller has IP 192.168.50.100 and is only able to use port 5000. The printer has IP 192.168.50.101 and is only able to use port 23. I want to use a router to redirect the traffic from port 5000 to port 23 and back.

I am struggeling for a few hours now but cant get it to work. I have searched in the topics but most topics are about port forwarding from wan and this is setup doesnt have a wan.

Can someone give me a small push in the right direction?

Thanks!
 
anav
Forum Guru
Forum Guru
Posts: 3131
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Re: Redirecting to another port

Thu Jul 18, 2019 1:18 am

The problem I see is that you use port 500 for all machine device traffic so intercepting port 500 traffic to send to the printer would block all other machine device traffic? At least that seems the logical issue. In other words, how does the router know when to direct the traffic from the machine to the printer?????
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
 
Sob
Forum Guru
Forum Guru
Posts: 4812
Joined: Mon Apr 20, 2009 9:11 pm

Re: Redirecting to another port

Thu Jul 18, 2019 1:42 am

If you don't have some unusual setup, both controller and printer are in same subnet. So if they want to communicate with each other, they will do it directly, they won't send anything to router. And if router doesn't get it, it can't do anything with it.

It could be possible to do something, but it depends on details, for start, how exactly is everything connected (both devices connected to this router, or using another switch, ...).

Also are you sure that the printer on port 23 uses the same communication protocol as controller on port 5000? Because if not, the whole exercise is pointless.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
BennyB
just joined
Topic Author
Posts: 3
Joined: Wed Jul 17, 2019 5:14 pm

Re: Redirecting to another port

Thu Jul 18, 2019 8:34 am

Thanks for your reply,

The only reason I want to use the router is because of the redirection. Normally it is just a point to point connection between printer and computer. So there is nothing in the network exept for the printer and the computer/machine controller. Also it is not connected to the internet.

Yes I am sure the protocols are the same. It are just some text strings I have to send over

Thank you
 
mkx
Forum Guru
Forum Guru
Posts: 3223
Joined: Thu Mar 03, 2016 10:23 pm

Re: Redirecting to another port  [SOLVED]

Thu Jul 18, 2019 8:53 am

You'll have to use /interface bridge settings set use-ip-firewall=yes, disable HW acceleration on one (or both) involved ether ports (to force traffic through router's CPU) and then construct appropriate NAT rules (probably a single rule would do but make it specific enough so that it doesn't mess with packets that it's not supposed to).
BR,
Metod
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1310
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Redirecting to another port

Thu Jul 18, 2019 10:15 am

they will do it directly
Lets say you have a Router, a Printer and a PC
Printer does listen on port `9200`.
Normal you could setup a print queue on the PC that points to Printer/9200
For some reason PC can not use port 9200.

So you could then setup Router to listen in port 8000.
Make the Router NAT port 8000 to Printer/9200
PC sets up a queue to Router/8000.

I think that should be doable.
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
 
BennyB
just joined
Topic Author
Posts: 3
Joined: Wed Jul 17, 2019 5:14 pm

Re: Redirecting to another port

Thu Jul 18, 2019 1:29 pm

You'll have to use /interface bridge settings set use-ip-firewall=yes, disable HW acceleration on one (or both) involved ether ports (to force traffic through router's CPU) and then construct appropriate NAT rules (probably a single rule would do but make it specific enough so that it doesn't mess with packets that it's not supposed to).
This works. Thank you very much for your help and also the other forum members for their reply.

Who is online

Users browsing this forum: Google [Bot] and 27 guests