D
D
Deejayko2021-04-08 14:53:36
Mikrotik
Deejayko, 2021-04-08 14:53:36

How to divide a network into subnets through 1 interface?

Good day! There is a local network with a Mikrotik Hap lite router and an unmanaged switch to which all 35 computers are connected. The router distributes addresses to all computers on the same subnet. The question is: how to divide this network into 2 subnets using Mikrotik? There is no possibility of switching from a switch to a router.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Deejayko, 2021-04-08
@Deejayko

And in interfaces it is necessary to do something??? And if there is +1 computer, how to make it connect to a specific subnet?

P
paxlo, 2021-04-08
@paxlo

First you need to specify the router as the gateway for all subnets. This is done very simply - the desired IP is added to the existing default bridge:

/ip address
add address=192.168.1.1/24 interface=bridge
add address=192.168.2.1/24 interface=bridge

Now the computers on which the handles assign ip from the above subnets, including the gateway and dns, will be on different subnets. But there is an option to assign addresses not by hand, but from the router. To do this, you need to configure a DHCP server.
Adding an address pool
/ip pool
add name=pool1 ranges=192.168.1.100-192.168.1.254
add name=pool2 ranges=192.168.2.100-192.168.2.254

Create 2 DHCP servers and tell them to use the above pools
/ip dhcp-server
add address-pool=pool1 disabled=no interface=bridge name=dhcp1
add address-pool=pool2 disabled=no interface=bridge name=dhcp2

We describe for each DHCP server what settings it will issue. In your case, the router itself (+ ntp server) is both the DNS server and the gateway.
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=192.168.1.1 gateway=192.168.1.1 ntp-server=192.168.1.1 
add address=192.168.2.0/24 dns-server=192.168.2.1 gateway=192.168.2.1 ntp-server=192.168.2.1

We give clients the necessary addresses by poppies:
/ip dhcp-server lease
add address=192.168.1.15 comment=pc01 mac-address=AA:AA:AA:AA:AA:AA server=dhcp1
add address=192.168.2.77 comment=pc02 mac-address=BB:BB:BB:BB:BB:BB server=dhcp2

In your case, Mikrotik already has a default pool and dhcp server 192.168.88.0/24, so if you only need 1 additional subnet, then you need to add only 1 line from each section (pool1 or pool2).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question