Community discussions

MikroTik App
 
jammane
just joined
Topic Author
Posts: 2
Joined: Sun Jul 27, 2014 3:49 pm

Configure multiple subnets with DHCP

Sun Jul 27, 2014 4:25 pm

I'm brand new to routerboard, so please bear with me.

I just purchased a crs125-24g-15-2hnd-in and have been fighting with it for about 2 days now. I am trying to set up the following configuration:

eth1->ISP
eth2-8 & wireless->subnet 1(10.x.x.x/8)
eth9-16->subnet 2 (172.16.x.x/16)
eth17-24->subnet 3 (192.168.12.x/24)

(although so far, I've only been able to successfully set /24 addresses)

For now, I want the switch to handle DHCP and DNS for all three subnets. The real servers will be coming later.

Later I will be setting up firewall rules (and hopefully NAT) so that subnet 3 can only access 1&2, subnet 2 can access 1 and ISP, subnet 1 can only access ISP

I was fighting with routeros 6.6, but had it upgrade to 6.17 just before posting this.

eth1-8 & wireless appear to be fine out of the box. I configured 9 with master none and designated 10-16 to have 9 as master. Also did the same for 17-24, and got DHCP to work on all three subnets.

I have been attempting every which way I can look up to set up static routes (preferably) or bridge the connections, but the routes never seem to go active and bridging attempts disable DHCP on the subnets.

Any assistance or steps you could provide will be helpful. I will probably reset to factory defaults again before implementing them, so any settings you may have questions about can be assumed to be factory default.
 
Rudios
Forum Veteran
Forum Veteran
Posts: 977
Joined: Mon Mar 11, 2013 12:58 pm
Location: The Netherlands

Re: Configure multiple subnets with DHCP

Tue Jul 29, 2014 3:22 pm

What are your exact prolems.
I read something about static routes, why do you need them?
Directly connected networks are routed by default.
If you have created 3 individual Switch groups, and put an IP address on each master-port together with the designated DHCP server you should be ok.
Then build your firewall rules as you require
 
h4ni8all
just joined
Posts: 3
Joined: Tue Jul 29, 2014 5:22 pm

Re: Configure multiple subnets with DHCP

Tue Jul 29, 2014 6:43 pm

Hi, this should get you started:
/interface bridge
add disabled=no name=LAN-bridge
add disabled=no name=LAN2-bridge
add disabled=no name=LAN3-bridge
create bridges for start.
/interface ethernet
set 0 disabled=no name=ether1-UPLINK
set 1 disabled=no name=ether2-LAN
set 2 disabled=no name=ether3-LAN
set 3 disabled=no name=ether4-LAN2
set 4 disabled=no name=ether5-LAN2
set 5 disabled=no name=ether6-LAN3
set 6 disabled=no name=ether7-LAN3
prepare your interfaces. I just added two in each subnet. you can add more as you need.
/ip pool
add name=lan ranges=10.0.0.10-10.255.255.254
add name=lan2 ranges=192.168.0.10-192.168.0.254
add name=lan3 ranges=172.16.0.0-172.16.255.254
Create dhcp pools.
/ip dhcp-server
add address-pool=lan disabled=no interface=LAN-bridge lease-time=1w name=LAN
add address-pool=lan2 disabled=no interface=LAN2-bridge lease-time=1w name=LAN2
add address-pool=lan3 disabled=no interface=LAN3-bridge lease-time=1w name=LAN3
created dhcp servers.
/interface bridge port
add bridge=LAN-bridge disabled=no interface=ether2-LAN
add bridge=LAN-bridge disabled=no interface=ether3-LAN
add bridge=LAN2-bridge disabled=no interface=ether4-LAN2
add bridge=LAN2-bridge disabled=no interface=ether5-LAN2
add bridge=LAN3-bridge disabled=no interface=ether6-LAN3
add bridge=LAN3-bridge disabled=no interface=ether7-LAN2
associate each port in its respective bridge.
/ip address
add address=10.0.0.1/8 disabled=no interface=LAN-bridge
add address=192.168.0.1/24 disabled=no interface=LAN2-bridge
add address=172.16.0.1/16 disabled=no interface=LAN3-bridge
Set up the gateways for your subnets.

/ip dhcp-server network
add address=10.0.0.0/8 comment="lan" dns-server=8.8.8.8 gateway=10.0.0.1 netmask=8
add address=192.168.0.0/24 comment="lan2" dns-server=8.8.8.8 gateway=192.168.0.1 netmask=24
add address=172.16.0.0/16 comment="lan3" dns-server=8.8.8.8 gateway=172.16.0.1 netmask=16
create dhcp servers



After this you're local side should be set. All you need now is NAT and set up your uplink towards ISP on ether1. Since I have no idea what kind of connection you have from them , its impossible to write anything.

HTH.

regards,
 
mcpbikram
just joined
Posts: 4
Joined: Tue Jul 22, 2014 7:16 pm

Re: Configure multiple subnets with DHCP

Tue Jul 29, 2014 9:42 pm

Hi
i just created a hotspot on the bridge interface of the mikrotik router with the default dhcp pool. this does not let me to access webfig. how do i create a different ip pool for hotspot and also assign a different lan ip for the router to access webfig.
anyone there to help??
thanks
Vicky.
 
jammane
just joined
Topic Author
Posts: 2
Joined: Sun Jul 27, 2014 3:49 pm

Re: Configure multiple subnets with DHCP

Sat Aug 02, 2014 10:20 am

Sorry it took so long to post back.

Rudios answer was what I needed.

My problem was that I was setting addresses to:
Address: 192.168.1.0/24
Network: 192.168.1.0
Interface: (Master Interface)

When the address should have been 192.168.1.1/24.