I’m new to router os and i need some help. So i live in a student hostel, where 2 types of vlan is used VLAN 200 is used for cable connecton and VLAN 300 for wifi. What i would like to do is that i connect two cables to my mikrotik hap ac 2. The cables come From a switch, one of them is connected to a port that uses vlan 200 the other one uses vlan 300. So what I would like to do that I connect vlan 200 to ether1 as a source of internet and use ether2-4 as a lan switch, and connect vlan 300 to ether5 and I want to use ether5 as the source of internet for my WiFi network. Is it possible somehow? Sorry for my bad English, I hope it’s clear, what I want to do.
You will mess with lots of IP configuration, so I advise you to connect using winbox and to MAC address of the device. And use one of ether2-4 to connect (they won’t have any change during the process).
By default, SOHO routerboards come configured with interfaces ether2-ether5 as a switched group. Remove ether5 from it. Default configuration has ether1 configured as WAN port with DHCP client running on it which won’t do any good any more, so remove DHCP client off ether1. Next remove all IP configuration (address, DHCP server, …) from interface bridge. Wireless is by default part of common bridge as well, you want to remove it.
Then create two vlan interfaces:
/interface vlan
add name=vlan200 vlan-id=200 interface=ether1 # ether1 for LAN access
add name=vlan300 vlan-id=300 interface=ether5 # ether5 for WiFi access
After that add interface vlan200 to bridge (together with ether2-4).
Next create another bridge for wifi (/interface bridge add name=bridge-wifi) and add interface vlan300 to it and add all wireless interfaces (wlan1 and wlan2 if your RB is dual-band) to newly created bridge.
Last: you probably want to check firewall to avoid some fellow-student to hack your router. Don’t forget to adjust settings of MAC accessibility (/tool mac-server) … but do this part in several steps (e.g. first set IP firewall so that you can connect to RB using winbox over IP … and only then change MAC server settings).
Note: whenever you fear that you might change something which will cut your management off (that might be just anything), enable safe mode, enter the change and if you can still work with RB, exit the safe mode. If management connection breaks while in safe mode, changes done while in safe mode will revert in a few seconds.