Community discussions

MikroTik App
 
BostjanC
just joined
Topic Author
Posts: 21
Joined: Tue Nov 13, 2018 9:28 pm

How to use Mikrotik router as a “switch”?

Tue Jan 15, 2019 9:05 pm

I want to use Mikrotik router as a “switch”.

I’ve tried several instructions I’ve found on the net, but at the end I had to reset the Mikrotik router several times so far (by holding down the reset button while powering it on).

I have one existing router xy brand with IP 192.168.1.1, which is also a gateway. It is also a DHCP on my 192.168.1.1/24 network.

I just want this MT router to have an IP 192.168.1.2 and to be a “switch” (bridge?) to other wired and wireless devices connected to it – so that they can talk to any device on my 192.168.1.1/24 network.


How to do that and not to reset it?

Thanks.
 
fbuster
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Sat May 02, 2015 12:52 pm
Location: BE

Re: How to use Mikrotik router as a “switch”?

Tue Jan 15, 2019 9:27 pm

depending on your model it can be a 4port or 5port switch
Here's a sample config:
/interface bridge
add name="My bridge"
/interface ethernet
set [ find default-name=ether1 ] name=ether1-To-modem
set [ find default-name=ether3 ] master-port=ether2
set [ find default-name=ether4 ] master-port=ether2
set [ find default-name=ether5 ] master-port=ether2
/interface bridge port
add bridge="My bridge" interface=ether1-To-modem
add bridge="My bridge" interface=ether2
 
BostjanC
just joined
Topic Author
Posts: 21
Joined: Tue Nov 13, 2018 9:28 pm

Re: How to use Mikrotik router as a “switch”?

Tue Jan 15, 2019 9:33 pm

It is hAP ac².

Your code just puts all interfaces to the bridge.
What about IP?
 
fbuster
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Sat May 02, 2015 12:52 pm
Location: BE

Re: How to use Mikrotik router as a “switch”?

Tue Jan 15, 2019 9:41 pm

Its a switch now , it doesnt need ip.
switching is layer 2 (mac)
 
BostjanC
just joined
Topic Author
Posts: 21
Joined: Tue Nov 13, 2018 9:28 pm

Re: How to use Mikrotik router as a “switch”?

Tue Jan 15, 2019 9:51 pm

Its a switch now , it doesnt need ip.
switching is layer 2 (mac)
What about DHCP?

If I want to update it, it says ERROR: could not resolve dns name.
 
zandhaas
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Tue Dec 11, 2018 11:02 pm
Location: The Netherlands

Re: How to use Mikrotik router as a “switch”?

Tue Jan 15, 2019 11:21 pm

I have a HAP ac2 and used the procedure described in the below post to configure it as an AP.

viewtopic.php?f=13&t=143446
 
User avatar
baragoon
Member Candidate
Member Candidate
Posts: 295
Joined: Thu Jan 05, 2017 10:38 am
Location: Kyiv, UA
Contact:

Re: How to use Mikrotik router as a “switch”?

Wed Jan 16, 2019 8:24 am

It is hAP ac².

Your code just puts all interfaces to the bridge.
What about IP?
add dhcp client to bridge
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11383
Joined: Thu Mar 03, 2016 10:23 pm

Re: How to use Mikrotik router as a “switch”?

Wed Jan 16, 2019 4:18 pm

Cook-book recipe by @fbuster is good for ROS version<6.41. For newer version, the recipe would be:
/interface bridge
add name=bridge
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=ether2
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
add bridge=bridge interface=ether5
# optionally: add bridge=bridge interface=wlan1
# etc.
#
#  For static IP address:
/ip address 
add address=192.168.1.2/24 interface=bridge network=192.168.1.0
# for internet access - ROS updates etc.
/ip route
add gateway=192.168.1.1
/ip dns
set servers=192.168.1.1 # or some other DNS server
#
# To run DHCP client, set thus instead:
/ip dhcp-client
add interface=bridge
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: How to use Mikrotik router as a “switch”?

Wed Jan 16, 2019 4:23 pm

Note that this is done automatically if you reset the device to CAPs mode - even if you don't have wireless interfaces or a CAPsMAN controller.

Keep holding the reset button for 5 more seconds, LED turns solid, release now to turn on CAPs mode (total 10 seconds).
 
nick252
just joined
Posts: 1
Joined: Tue Sep 08, 2020 10:09 pm

Re: How to use Mikrotik router as a “switch”?

Tue Sep 08, 2020 10:16 pm

It works on hex s, on all ports, but doesn't work on sfp1 port
 
User avatar
qatar2022
Member Candidate
Member Candidate
Posts: 141
Joined: Mon Aug 24, 2020 11:12 am

Re: How to use Mikrotik router as a “switch”?

Tue Oct 05, 2021 10:26 am

i try it and worked perfectly

Who is online

Users browsing this forum: donkeyKong, ItchyAnkle, Soleous75 and 84 guests