Community discussions

MikroTik App
 
User avatar
on4aa
just joined
Topic Author
Posts: 5
Joined: Thu Jan 26, 2017 8:45 pm

How to configure a MikroTik hAP ac lite as a Layer 2 switch?

Thu Jan 26, 2017 9:30 pm

Here is an overview of the network topology:
Image

Both the Fritz!Box 7340 and MikroTik hAP ac lite router currently act as DHCP servers, effectively splitting the network in two LANs. The MikroTik router was also configured as a bridge for the
192.168.88.xxx
LAN.

In order to avoid the trouble of double NAT, I would like to reconfigure the MikroTik hAP ac lite as a Layer 2 switch. There are advantages of doing so over double NATing.

All DHCP and NAT should be handled exclusively by the Fritz!Box. Furthermore, the MikroTik hAP ac lite should have a static IP address in the same local IP address range so it can still be managed over its web interface.

The Fritz!Box configuration is not an issue. However, I am an utter newbie managing MikroTik's RouterOS and I found no instructions on the web concerning this specific problem. Hence, my question:

What are the (detailed) steps to configure a MikroTik hAP ac lite as a Layer 2 switch, removing its DHCP server whilst keeping a static IP address for management?

By the way, I am on GNU/Linux, so using Winbox is not an option for me.
Last edited by on4aa on Fri Jan 27, 2017 10:01 pm, edited 2 times in total.
 
User avatar
on4aa
just joined
Topic Author
Posts: 5
Joined: Thu Jan 26, 2017 8:45 pm

Re: How to configure a MikroTik hAP ac lite as a Layer 2 switch?

Fri Jan 27, 2017 1:44 am

For those interested in gaining some reputation points, I also posted this very same question over at SuperUser SE.
 
Van9018
Long time Member
Long time Member
Posts: 558
Joined: Mon Jun 16, 2014 6:26 pm
Location: Canada - Abbotsford

Re: How to configure a MikroTik hAP ac lite as a Layer 2 switch?

Fri Jan 27, 2017 2:57 am

IP > DHCP Server, delete the dhcp server for bridge-local
IP > Addresses, replace IP address for bridge-local to your desired IP (192.168.178.x/24)

At this point, Ports 2-5 and wifi are considered a switch. ether1 remains the gateway. If you want to use ether1 as another port in the switch...

IP > DHCP Client, delete DHCP Client for ether1
Bridge > Ports, add ether1 to bridge-local.
IP > Firewall > NAT, delete the masquerade rule

That's about it I think.

When I make a Mikrotik into a switch, I usually don't assign a static IP to the switch, rather I use DHCP instead. Winbox will detect it, and it's one less static IP to make note of.
IP > DHCP Client, Add, interface = bridge-local (instead of adding IP via IP > Addresses)

I also set the identity to something useful so if Winbox detects 10 switches, they show up with their identity in the list.

I also set up NTP so the switch polls NTP servers for the correct time. Helps with troubleshooting and reading the log file.
 
User avatar
on4aa
just joined
Topic Author
Posts: 5
Joined: Thu Jan 26, 2017 8:45 pm

Re: How to configure a MikroTik hAP ac lite as a Layer 2 switch?

Fri Jan 27, 2017 2:31 pm

On the MikroTik support pages, I came across an article about how to configure a DHCP relay.
It is not clear to me whether a DHCP relay is the same thing as a Layer 2 switch or just part of it?
Image
 
User avatar
on4aa
just joined
Topic Author
Posts: 5
Joined: Thu Jan 26, 2017 8:45 pm

Re: How to configure a MikroTik hAP ac lite as a Layer 2 switch?

Fri Jan 27, 2017 3:05 pm

Thank you for your very useful answer. I forgot to mention that I cannot use Winbox because I am on GNU/Linux. Would below statement still stand for the web or command line interface?
When I make a Mikrotik into a switch, I usually don't assign a static IP to the switch, rather I use DHCP instead. Winbox will detect it, and it's one less static IP to make note of.
IP > DHCP Client, Add, interface = bridge-local (instead of adding IP via IP > Addresses)

I also set the identity to something useful so if Winbox detects 10 switches, they show up with their identity in the list.
Also, what would be the difference between your answer and the DHCP relay configuration as suggested on the MikroTik wiki?
Last edited by on4aa on Sun Mar 05, 2017 2:21 pm, edited 1 time in total.
 
Van9018
Long time Member
Long time Member
Posts: 558
Joined: Mon Jun 16, 2014 6:26 pm
Location: Canada - Abbotsford

Re: How to configure a MikroTik hAP ac lite as a Layer 2 switch?

Fri Jan 27, 2017 9:22 pm

If you can't use Winbox, then a static IP may be easier/simpler. There is no way for a web browser to detect Mikrotik devices on the network, you'd have to know the IP to connect. I heard winbox works with WINE for linux.

DHCP relay is not the same thing as a layer2 switch. With the Mikrotik configured as a swtich, all packets will flow through it. So a DHCP request will be fulfilled by the router (or whatever is handing out DHCP).

Typically a LAN has its own DHCP Server. A DHCP Relay is for when you have multiple LANs but the DHCP server is on a different subnet.
 
User avatar
on4aa
just joined
Topic Author
Posts: 5
Joined: Thu Jan 26, 2017 8:45 pm

Re: How to configure a MikroTik hAP ac lite as a Layer 2 switch?

Sun Mar 05, 2017 2:20 pm

Winbox runs fine under wine.
This also happens to be the official way of running Winbox on GNU/Linux.

Who is online

Users browsing this forum: dervomsee, ejaka2s, Majestic-12 [Bot] and 214 guests