Community discussions

MikroTik App
 
HiPiGG
just joined
Topic Author
Posts: 1
Joined: Thu Sep 28, 2023 9:29 am

Is it possible to bind all ports at the top layer and manually allocate IP addresses to specific devices

Thu Sep 28, 2023 9:52 am

Regarding using DHCP on different PORTs individually, is it possible to bind all ports at the top layer and manually allocate IP to specific devices?

First, please forgive my limited English proficiency, as it is not my primary language. If there are any descriptions or explanations that are unclear, I apologize in advance.
I am currently using a CCR1036-8G-2S router with a fixed IP for WAN. Each of the ETH3 to ETH8 ports is connected to multiple 48 PORT HUBs, each configured in separate rooms. I have set up individual DHCP servers for each port, and they are working well. Computers from different DHCP servers can also communicate with each other.
For example:
Computers in Room 1 can obtain IPs from 192.168.3.10 to 192.168.3.200.
Computers in Room 2 can obtain IPs from 192.168.4.10 to 192.168.4.200.
Computers in Room 3 can obtain IPs from 192.168.5.10 to 192.168.5.200.

However, some devices, such as network printers or file servers, have fixed and specific IPs to maintain their previous configurations. For instance:
Room 1 has two printers and one NAS with IPs 192.168.200.20, 192.168.200.55, and 192.168.210.50.
Room 2 has two printers with IPs 192.168.200.15 and 192.168.200.40.
Room 3 has one printer and one NAS with IPs 192.168.200.10 and 192.168.210.100.
Image

Since these devices are already in use, and their IP addresses cannot be changed due to the age-related frequent failures of network equipment, it has been requested that these devices at least retain their previous IP configurations after communication, and these devices are distributed across different rooms.

Attach an architectural diagram for clarification. I cannot use separate ports to connect to specialized devices because most of these devices are immovable fixed equipment, and the network cabling does not allow for such arrangements. Additionally, the end-point HUB has a single function, and it does not support VLAN functionality either.

How can I configure these devices that are not part of the DHCP assignments to communicate in other rooms? Thank you, everyone.

Image
Image
Image
Image
Image
Image
Image
Image
 
Dario1982
just joined
Posts: 22
Joined: Sat Dec 29, 2018 6:23 pm

Re: Is it possible to bind all ports at the top layer and manually allocate IP addresses to specific devices

Thu Sep 28, 2023 2:55 pm

If I understood well all the legacy devices are either under 192.168.200.x and 192.168.201.x (I assume are /24).

In this case if you create the interfaces for these networks and assign them one address from the subnet on the CCR then you will have the gateway for 200 and 201 and they will be part of the local routing table and you can forward traffic among all.

Or do you have to keep the legacy gateway of those?
 
Dario1982
just joined
Posts: 22
Joined: Sat Dec 29, 2018 6:23 pm

Re: Is it possible to bind all ports at the top layer and manually allocate IP addresses to specific devices

Thu Sep 28, 2023 3:07 pm

Perhaps a too shoort reply.
What I mean is that with that topology I would work with bridge and VLAN and defining trunk ports as link between router and switches as you it looks you have to carry at least two subnets for every physical interface.

Of course this assume that you have switches that can be used to setup vlan as well.
 
User avatar
pants6000
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Fri Sep 26, 2014 5:30 am

Re: Is it possible to bind all ports at the top layer and manually allocate IP addresses to specific devices

Fri Sep 29, 2023 12:13 am

Disclaimer: I don't know if this will work on ROS but it feels like it should... and I am lazy.

Try, for example, putting 192.168.200.1/24 on a bridge (with no ports on it, used like a loopback int on other platforms), and then adding a /32 route to each printer with the connected interface as the gateway.
/ip route add dst-address=192.168.200.15/32 gateway=ether7
, etc.

You might need proxy-arp to make it work fully.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 13602
Joined: Thu Mar 03, 2016 10:23 pm

Re: Is it possible to bind all ports at the top layer and manually allocate IP addresses to specific devices  [SOLVED]

Fri Sep 29, 2023 8:24 am

Try, for example, putting 192.168.200.1/24 on a bridge (with no ports on it, used like a loopback int on other platforms), and then adding a /32 route to each printer with the connected interface as the gateway.

It might work, but it's still wrong. As soon as physical interfaces are attached as bridge ports, they cease to be interfaces... while for L3 (addressing, routing) router uses interfaces. Which is "bridge" interface in case of bridge with ports. We've seen on this forum a few odd problems which were cured by strictly using bridge interface instead of slave physical interfaces.

And my 5 cents on original problem: DHCP server is only aware of physical ports when bridge/switch runs some sort of DHCP agent and is configured to include port identity in upstream DHCP request. If @OP wants to keep things simple, he really should go either with VLANs or with interface-per-subnet ... this makes L3 setup much easier. The complication with printers being kept in a separate subnet is trivially solvable when using VLANs and a bit more complicated if using interface-per-subnet (as printers would reside in alien IP subnets ... possibly also printers would have to be reconfigured to be able to use correct gateway).