I need to connect 4 “industry machines”. Everyone use same subnets 192.168.0.0, network device inside macihne have same static IP and I’cant change them. Inside machine is switch whitch networking two internal devices (192.168.0.2, 192.168.0.3) and some device for managing machine.
Managing this machine means connect them with TCP on IP 192.168.0.2 port 1234 and push some data. (Which is step one. Step two i the same on port 1235).
My idea is to make connection to 192.168.2.2 (ether1/LAN IP of routerboard ether1) on port 12341. Routerboard will translate this connection to 192.168.0.2 on machine1/ether2 to port 1234. (port 12342 come to machine2:port1234, port 12343 come to machine3:port1234, etc.).
Is possible to do same magic on routerboard to make it work?
Could it be so: put router to each machine, set nat with internal network for machine and external to your network. Then port translation will work. Looking from your network it will look like the machines have their own unique ip.
/ip route print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 A S 192.168.0.0/24 ether2-shark1 1
1 A S 192.168.0.0/24 ether3-shark2 1
2 S 192.168.0.0/24 ether4-shark3 1
3 S 192.168.0.0/24 ether5-shark4 1
4 ADC 192.168.0.0/24 192.168.0.22 ether2-shark2 0
ether3-shark1
ether4-shark3
ether5-shark4
5 ADC 192.168.2.0/24 192.168.2.2 ether1-gateway 0
Looks, that it works.
Jarda: thx for reply. Yes, this will be more “normal” solution. But uses more routers.