Community discussions

MikroTik App
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

two dhcp server on one interface

Tue Jul 26, 2022 4:26 pm

greetings ..1
so i have 951ui mikrotik router with 6.48 firmware version and the internet came to the router from Eth-1, Eth-1 interface ip =192.168.1.254/24 .
Now the Eth-2 interface ip is : 192.168.10.1/24
so i can normaly get internet access from Eth-2 when i set the nat-route and the DHCP server rule on the 192.168.10.1 range. BUT what i want is to get internet access from the DHCP range 172.16.0.1/24 from the same interface, so is there is a way to achieve that..?
please advise me and thanks in advance.
if any further info is require to solve this i am ready.
 
Zacharias
Forum Guru
Forum Guru
Posts: 3459
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: two dhcp server on one interface

Tue Jul 26, 2022 4:32 pm

Many information are missing.
Where is ether2 going to ? another switch ?
What is the purpose of the second subnet ?

If you need to segmentate your network then VLANs is the way to go...
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19323
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: two dhcp server on one interface

Tue Jul 26, 2022 4:32 pm

Dont understand.
Please state your requirements based on users/devices, single or groups
Identify them, and identify what they need to do and should not be able to do.
A network diagram tells us what devices you have, what the ports are connected to and what subnets are going over those ports.
With that information, much more can be provided.
 
erlinden
Forum Guru
Forum Guru
Posts: 1958
Joined: Wed Jun 12, 2013 1:59 pm
Location: Netherlands

Re: two dhcp server on one interface

Tue Jul 26, 2022 4:35 pm

You mean you want your clients to get a 172.16.0.0/24 address instead of the current 192.168.10.0/24?
Like...changing both IP address of the router and DHCP scope?

https://help.mikrotik.com/docs/display/ ... DHCPServer
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: two dhcp server on one interface

Tue Jul 26, 2022 4:52 pm

Please split the DHCP issue from the subnet issue.
There is no DHCP needed to use some subnet.

If your ether2 (or bridge, if ether2 is port on the bridge) has 2 IP addresses, both subnets can be used.

E.G. 192.168.10.1/24 , as IP address on ether2 (or bridge) has 192.168.10.1 as gateway for subnet 192.168.10.0/24 network.
E.G. 172.16.0.1/24 , as 2nd IP address on ether2 (or bridge) , has 172.16.0.1 as gateway for any member of subnet 172.16.0.0/24

Now the DHCP issue. If 2 DHCP servers are defined on one interface, ether2 (or bridge, if ether2 is port on bridge), which DHCP will respond?
Same problem with one DHCP sever and multiple pools (scopes). Not easy, even with superscope (Windows)

Sometimes static DHCP entries take always precedence. So you can force a MAC to use a specific address (from the pool or not)
Others will split the LAN in VLANs per subnet, (One or more DHCP servers can serve part of that VLAN subnet, with the correct pool)

Devices from 2 different subnets on the same LAN, need routing to talk to each other. The RB951ui with addresses in both subnets can do that.(if FW rules allow inter-LAN traffic)
By default the NAT rule and "default gateway" is linked to the WAN interface. So ALL LAN networks (or subnets) can access the internet with the same default rules.
i set the nat-route and the DHCP server rule on the 192.168.10.1 range
That is you limiting that NAT rule to only work for that subnet. either extend that NAT rule with the other subnet or remove/alter the limitation
Limitation should be outgoing interface or interface-list. Otherwise it would be activated for LAN-LAN routing
Last edited by bpwl on Tue Jul 26, 2022 5:06 pm, edited 2 times in total.
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: two dhcp server on one interface

Tue Jul 26, 2022 5:03 pm

Many information are missing.
Where is ether2 going to ? another switch ?
to my PC
What is the purpose of the second subnet ?
well.. just to get internet access from it no thing special. also i want to disable the 192.168.10.1/24 and replaced with 172.16.1.0/24 but the interface to stay 192.168.10.1/24
If you need to segmentate your network then VLANs is the way to go...
i didn't understand what you mean by that..?
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: two dhcp server on one interface

Tue Jul 26, 2022 5:06 pm

Dont understand.
Please state your requirements based on users/devices, single or groups
Identify them, and identify what they need to do and should not be able to do.
A network diagram tells us what devices you have, what the ports are connected to and what subnets are going over those ports.
With that information, much more can be provided.
i will provide that Mr anav..thanks for your replay
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: two dhcp server on one interface

Tue Jul 26, 2022 5:10 pm

You mean you want your clients to get a 172.16.0.0/24 address instead of the current 192.168.10.0/24?
Like...changing both IP address of the router and DHCP scope?

https://help.mikrotik.com/docs/display/ ... DHCPServer
yes that's what i want Mr erlinden ..i want to distribute the 172.16.1.0/24 range on the Eth-2 interface that have the 192.168.10.254 ip address
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: two dhcp server on one interface

Tue Jul 26, 2022 5:28 pm

Please split the DHCP issue from the subnet issue.
There is no DHCP needed to use some subnet.

If your ether2 (or bridge, if ether2 is port on the bridge) has 2 IP addresses, both subnets can be used.

E.G. 192.168.10.1/24 , as IP address on ether2 (or bridge) has 192.168.10.1 as gateway for subnet 192.168.10.0/24 network.
E.G. 172.16.0.1/24 , as 2nd IP address on ether2 (or bridge) , has 172.16.0.1 as gateway for any member of subnet 172.16.0.0/24

Now the DHCP issue. If 2 DHCP servers are defined on one interface, ether2 (or bridge, if ether2 is port on bridge), which DHCP will respond?
Same problem with one DHCP sever and multiple pools (scopes). Not easy, even with superscope (Windows)

Sometimes static DHCP entries take always precedence. So you can force a MAC to use a specific address (from the pool or not)
Others will split the LAN in VLANs per subnet, (One or more DHCP servers can serve part of that VLAN subnet, with the correct pool)

Devices from 2 different subnets on the same LAN, need routing to talk to each other. The RB951ui with addresses in both subnets can do that.(if FW rules allow inter-LAN traffic)
By default the NAT rule and "default gateway" is linked to the WAN interface. So ALL LAN networks (or subnets) can access the internet with the same default rules.
i set the nat-route and the DHCP server rule on the 192.168.10.1 range
That is you limiting that NAT rule to only work for that subnet. either extend that NAT rule with the other subnet or remove/alter the limitation
Limitation should be outgoing interface or interface-list. Otherwise it would be activated for LAN-LAN routing
Hi Mr bpwl ..! very thanksful for you time..!
i don't want to use the 192.168.10.1/24 as DHCP server, for more clarification i am asking the following
i assigned the 192.168.10.1/24 as an address for the Eth-2 interface ..ok.
then i go to ip-dhcp server and instead of using the default dhcp -(192.168.10.2-192...etc)- i use the -(172.16.1.0-172.16.1..etc)- so i couldn't get internet access. yet, my pc get ip address .however, in the same configuration when i use the default dhcp range -(192.168.10.1-192.168.10...)- i get internet access.
can you clarify what you mean by
extend that NAT rule with the other subnet
please..?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11593
Joined: Thu Mar 03, 2016 10:23 pm

Re: two dhcp server on one interface

Tue Jul 26, 2022 5:35 pm

First add address from new subnet to ether2 ... so it ends up with both 192.168.10.1/24 and (say) 172.16.0.1/24 addresses on the interface at the same time.

After that go and change DHCP settings: address pool and network settings to match new IP subnet in use, new IP address of router as gateway, possibly new IP address of DNS server(s) etc.

After that (in a few days/weeks), when none of devices is stil ussing old IP address, remove old IP address 192.168.10.1/24 from ether2.

It can't work if you set client devices to new IP subnet but your router (the routing part of it) know nothing about it. Setting it in DHCP server is not enough.

Who is online

Users browsing this forum: Amazon [Bot] and 47 guests