Hi all. I have general idea about networking and I ran into the problem that I need to solve.
Let's say we have device that have web UI accessible through ethernet, only with GChrome by entering https://192.168.255.129.
The PC must have static IP address 192.168.255.130 subnet 255.255.255.0 in ipv4 settings of the ethernet.
The problem, I need to connect, and have constant connection in multiple Chrome windows to 5 devices simultaneously, not one by one, not one after another, all 5 at the same time, in 5 different Chrome windows.
The IP of the device is not changeable, it should stay the same, it's preset by manufacturer. No, it can not be changed on the device itself.
What I would like to do is, to do the forwarding of each endividual ethernet port on my router RB5009UG+S+IN.
My pc on ether1.
Device 1 on ether2
Dev2 on ether3
Dev3 on ether4
And so on.
The idea is to make router adress to the right device with custom IP that I'll assign them with.
Let's say. Dev1 192.168.255.11
Dev2 192.168.255.12
Dev3 192.168.255.13
Etc.
So if I enter 192.168.255.12 in Chrome adress bar, the router knows that it needs to send this request to dev2 that is on ether2 on https://192.168.255.129. And then return the reply the same way back to that Chrome window.
I made a little config, please advise if it'll work. Or maybe you know better solution..
ip route vrf
add interfaces=ether2 routing-mark=DEV1
add interfaces=ether3 routing-mark=DEV2
add interfaces=ether4 routing-mark=DEV3
add interfaces=ether5 routing-mark=DEV4
add interfaces=ether6 routing-mark=DEV5
/ip address
add address=192.168.255.1 interface=ether1 network=192.168.255.0
add address=192.168.255.3 interface=ether2 network=192.168.255.4
add address=192.168.255.3 interface=ether3 network=192.168.255.4
add address=192.168.255.3 interface=ether4 network=192.168.255.4
add address=192.168.255.3 interface=ether5 network=192.168.255.4
add address=192.168.255.3 interface=ether6 network=192.168.255.4
/ip address
add address=192.168.255.11 interface=ether1 network=192.168.255.0
add address=192.168.255.12 interface=ether1 network=192.168.255.0
add address=192.168.255.13 interface=ether1 network=192.168.255.0
add address=192.168.255.14 interface=ether1 network=192.168.255.0
add address=192.168.255.15 interface=ether1 network=192.168.255.0
/ip firewall mangle
add action=mark-routing chain=prerouting dst-address=192.168.255.11 new-routing-mark=DEV1
add action=mark-routing chain=prerouting dst-address=192.168.255.12 new-routing-mark=DEV2
add action=mark-routing chain=prerouting dst-address=192.168.255.13 new-routing-mark=DEV3
add action=mark-routing chain=prerouting dst-address=192.168.255.14 new-routing-mark=DEV4
add action=mark-routing chain=prerouting dst-address=192.168.255.15 new-routing-mark=DEV5
/ip firewall mangle
add action=mark-routing chain=prerouting dst-address=192.168.255.130 new-routing-mark=main
/ip firewall nat
add action=dst-nat chain=dstnat dst-address=192.168.255.11 in-interface=ether1 to-addresses=192.168.255.129
add action=src-nat chain=srcnat out-interface=ether2 to-addresses=192.168.255.3
add action=dst-nat chain=dstnat dst-address=192.168.255.12 in-interface=ether1 to-addresses=192.168.255.129
add action=src-nat chain=srcnat out-interface=ether3 to-addresses=192.168.255.3
add action=dst-nat chain=dstnat dst-address=192.168.255.13 in-interface=ether1 to-addresses=192.168.255.129
add action=src-nat chain=srcnat out-interface=ether4 to-addresses=192.168.255.3
add action=dst-nat chain=dstnat dst-address=192.168.255.14 in-interface=ether1 to-addresses=192.168.255.129
add action=src-nat chain=srcnat out-interface=ether5 to-addresses=192.168.255.3
add action=dst-nat chain=dstnat dst-address=192.168.255.15 in-interface=ether1 to-addresses=192.168.255.129
add action=src-nat chain=srcnat out-interface=ether6 to-addresses=192.168.255.3