Page 1 of 1

Two subnets, two interfaces

Posted: Sat Dec 09, 2017 12:20 pm
by elmex
I am trying to do something so extremely simple but I just can't get it to work. I recently got hold of a RB2011UiAS-RM and I am trying to configure it so that I have a separate subnet for my home automation project. I followed the steps described; here with some differences, only two subnets and one additional interface. What I am trying to achieve is this:

ETH1 - WAN port bridged to ETH2, DHCP client; my bridged modem connects to this
ETH2 - Master interface at, network
ETH3-ETH5 - Slaves of ETH2
DHCP server for the range on ETH2

The above actually works as its more or less the default configuration. So now I am trying to get the following configuration to work on for the home automation subnet;
ETH6 - Master interface set to, network
ETH7-10 - Slaves of ETH6
DHCP server for the range on ETH6

I suspect I did something wrong in the routing because when I go to IP > Routes it says the ETH6 interface cannot be reached. Also because of this, I think, the DHCP-server shows up red. This seems such a simple and standard problem but I just can't seem to figure it out. I have moderate networking skills so I figured I couldn't be that hard but after a few evenings I am almost ready to give everything up and use Openwrt. I really hope someone can help me (I can provide configs if necessary) .

Re: Two subnets, two interfaces

Posted: Sat Dec 09, 2017 2:10 pm
by CZFan
Firstly, I will remove Ether1 from the bridge in order to make use of your fiirewall between LAN and Internet and use routing to access the internet.

Make sure Ether6 is enabled and not disabled by accident

Re: Two subnets, two interfaces

Posted: Mon Dec 11, 2017 5:48 pm
by elmex
Firstly, I will remove Ether1 from the bridge in order to make use of your fiirewall between LAN and Internet and use routing to access the internet.

Make sure Ether6 is enabled and not disabled by accident
Thanks! I've double checked that Ether6 was enabled but I couldn't get it to work. Instead of removing the bridge I tried to build everything from scratch, it is still not working unfortunately. I hope someone has time to check my config (I'm sure this will be a noob mistake). LAN works with DHCP but the DHCP-server on HA keeps assigning and reassigning IP addresses to the same MAC every second. Edit\ I've moved the ports around a bit so ether1 is wan, ether2 is lan, ether3 is wlan and I now use ether4 for home automation (HA).

My config, thanks again to anyone who has time to look at this:
/interface ethernet
set [ find default-name=ether1 ] comment=WAN
set [ find default-name=ether2 ] comment=LAN
set [ find default-name=ether3 ] comment=WLAN master-port=ether2
set [ find default-name=ether4 ] comment=HA
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=HA ranges=
add name=LAN ranges=
add name=dhcp_pool2 ranges=
/ip dhcp-server
add address-pool=HA disabled=no interface=ether4 lease-time=1d name=HA
add address-pool=LAN disabled=no interface=ether2 lease-time=1d name=LAN \
/ip address
add address= interface=ether4 network=
add address= interface=ether2 network=
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/ip dhcp-server network
add address= dns-server= gateway=
add address= dns-server= gateway=
/ip dns static
add address= name=router.lan
/ip firewall filter
add action=drop chain=input dst-port=53 in-interface=ether1 protocol=udp
/ip firewall nat
add action=masquerade chain=srcnat src-address=
/ip route
add distance=1 gateway=ether1

Re: Two subnets, two interfaces

Posted: Fri Dec 15, 2017 2:06 pm
by elmex

Re: Two subnets, two interfaces  [SOLVED]

Posted: Sun Dec 17, 2017 9:06 pm
by giorgiop
Good evening!
first of all, get yourself a backup and change the following
/ip pool
add name=LAN ranges= <--- Change the record to .1.254, 0 & 255 cant be used.
add name=dhcp_pool2 ranges= <--- Delete this record as you already have it in LAN, second because it's not used from any of your DHCP servers. I suppose you set up a dhcp with the wizard but changed your mind while setting up and didnt finish, yet the pool remained :p

DHCPs, you have one on eth2 ( but the second one runs on eth4, not eth6? Also the eth4 has the ip instead of eth6? On your 1st post you write that 3-5 are slaves to 2, 7-10 are slaves of eth6 but the ip is on 4, not 6 I suppose you must change the 3nd DHCP to run on 6 and move ip address from 4 to 6

/ip route, i think that if you run a dhcp client with peer dns checked, there is no need for route as it comes auto from the main DHCP(not in 2011). just disable, no need i think (except if that's the D one created from the client)

/interface ethernet
set [ find default-name=ether4 ] comment=HA <-- is that 4 or 6?

Re: Two subnets, two interfaces

Posted: Sun Dec 17, 2017 10:43 pm
by elmex
Thanks giorgiop! I managed to get it working with your instructions. Yes I changed a lot in between the two posts which makes everything even more confusing. I now just use eth2 and eth4, which works very good.

I have been reading about networks a bit more because there were some things I didn't fully understand yet. I found that compared to openwrt nothing is defined implicitly in RouterOS, this means you really have to understand how networks operate (and the OSI model for example). Together with your help I was able to solve the problem, so thanks again.

Re: Two subnets, two interfaces

Posted: Mon Dec 18, 2017 8:47 am
by giorgiop
You are welcome :-)
Good to know that i helped