Community discussions

MikroTik App
 
richardhkirkando
just joined
Topic Author
Posts: 14
Joined: Mon Aug 25, 2008 9:11 pm

DHCP pool shared across multiple VLANs

Sun Sep 29, 2013 8:47 pm

I'm looking to migrate several VLANs from a Cisco layer 3 switch to Mikrotik. I'd like to have several VLANs share a single DHCP pool - on my current Cisco setup, I'm able to do this by creating a loopback interface that acts as a gateway for a large subnet, and each VLAN interface has ip unnumbered to the loopback interface. This allows me to keep VLANs separate, but also not have to worry about tons of DHCP pools filling up. It works quite well for my setup, but I need to add some authentication features available in RouterOS.

Separate pools for each VLAN results in too many wasted IPs, and it's more of an administration hassle than I prefer to deal with. Is there any way to do something similar with RouterOS?
 
efaden
Forum Guru
Forum Guru
Posts: 1708
Joined: Sat Mar 30, 2013 1:55 am
Location: New York, USA

Re: DHCP pool shared across multiple VLANs

Mon Sep 30, 2013 2:13 am

I'm looking to migrate several VLANs from a Cisco layer 3 switch to Mikrotik. I'd like to have several VLANs share a single DHCP pool - on my current Cisco setup, I'm able to do this by creating a loopback interface that acts as a gateway for a large subnet, and each VLAN interface has ip unnumbered to the loopback interface. This allows me to keep VLANs separate, but also not have to worry about tons of DHCP pools filling up. It works quite well for my setup, but I need to add some authentication features available in RouterOS.

Separate pools for each VLAN results in too many wasted IPs, and it's more of an administration hassle than I prefer to deal with. Is there any way to do something similar with RouterOS?
Could you just make a new DHCP-Server for each VLAN and use the same pool?
 
richardhkirkando
just joined
Topic Author
Posts: 14
Joined: Mon Aug 25, 2008 9:11 pm

Re: DHCP pool shared across multiple VLANs

Mon Sep 30, 2013 6:20 pm

Could you just make a new DHCP-Server for each VLAN and use the same pool?
That's what I've been trying to set up, but so far haven't been able to get the configuration right. Seems that hosts on only one interface at a time can reach any given destination IP. Relevant config portions look like this:
/ip address
add address=x.x.x.33/27 interface=vlan1234 network=x.x.x.32
add address=x.x.x.33/27 interface=vlan1235 network=x.x.x.32

/ip pool
add name=dhcp_pool ranges=x.x.x.34-x.x.x.62

/ip dhcp-server
add address-pool=dhcp_pool disabled=no interface=vlan1234 lease-time=2m name=dhcp-1234
add address-pool=dhcp_pool disabled=no interface=vlan1235 lease-time=2m name=dhcp-1235

/ip dhcp-server network
add address=x.x.x..32/27 dns-server=1.1.1.1,1.1.1.2 gateway=x.x.x.33
 
richardhkirkando
just joined
Topic Author
Posts: 14
Joined: Mon Aug 25, 2008 9:11 pm

Re: DHCP pool shared across multiple VLANs

Mon Sep 30, 2013 8:50 pm

Ok, seems to be working as long as I add a static route for each DHCP client IP /32 through the proper VLAN interface. Seems that the Cisco does this automatically. Any thoughts as to how to handle this in RouterOS?
 
mjperry82
just joined
Posts: 17
Joined: Wed Feb 06, 2013 11:02 pm

Re: DHCP pool shared across multiple VLANs

Mon Sep 30, 2013 10:15 pm

What happens if you add a route to the /27 on all vlan interfaces and enable the 'add arp for leases' option on the dhcp server?
 
User avatar
richinuk
Member Candidate
Member Candidate
Posts: 149
Joined: Tue Jan 22, 2008 9:30 pm

Re: DHCP pool shared across multiple VLANs

Wed Oct 02, 2013 11:58 am

You could try putting a single DHCP server on a bridge interface on the MT with the VLAN's connected to that same bridge (just like on your Cisco).

Out of curiosity, what is the use case for multiple VLAN's all bridged together using the same subnet?

Rich
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: DHCP pool shared across multiple VLANs

Wed Oct 02, 2013 1:57 pm

do not forget that it is possible to send additional options to clients, for example, additional routes, if all of sudden configuration you have set up for DHCP-server is not working and additional configuration is required on the client side.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7053
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: DHCP pool shared across multiple VLANs

Wed Oct 02, 2013 2:03 pm

You can't have addresses from the same network on two different interfaces.
To make it work either bridge both interfaces and run one DHCP server ob bridge, or split /27 network in two subnets.
 
redflag237
just joined
Posts: 21
Joined: Mon Aug 12, 2013 1:17 pm

Re: DHCP pool shared across multiple VLANs

Wed Oct 02, 2013 3:31 pm

Take a look at the Layer2-Switching Capabilities of your Mikrotik Device, maybe this is enough your your needs.
 
falz
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Tue Jun 03, 2008 10:54 pm

Re: DHCP pool shared across multiple VLANs

Thu Oct 03, 2013 4:02 pm

It looks like there's a dchp server lease-script and maybe a binding-script (is this v6 only?) If you could pass the interface name to it, it could possibly add or remove the static route upon lease assign/deassign.

Who is online

Users browsing this forum: Bing [Bot], fadelliz78 and 80 guests