I’ve got an issue with understanding how to use VLAN 1 as a management VLAN on a Mikrotik device. The tests I’ve been doing on a hAP ac² with a switch cpu which is not capable of VLAN filtering in hardware, therefore I used the approach depicted here: https://wiki.mikrotik.com/wiki/Manual:Basic_VLAN_switching#Other_devices_with_built-in_switch_chip. Using another VLAN ID for the management VLAN is not an option as the entire infrastructure uses it. The only workaround could be to use it as untagged traffic on the trunk port but that would be entirely inconsistent with the rest of the infrastructure. Another option could be to rename the ID on the fly - like VLAN 1 ingress rename to VLAN 99 on Mikrotik and other way round egress - I don’t know if Mikrotik can handle that.
I’ve been using the following config with VLAN 150 as a management VLAN - connections to the switch’s address 192.168.0.70 work both via VLAN 150 on the trunk interface as well the access port ether2:
# jan/02/1970 00:44:39 by RouterOS 6.46.3
# software id = BGF7-UZLL
#
# model = RBD52G-5HacD2HnD
/interface bridge
add name=bridge
/interface vlan
add interface=bridge name=OAM vlan-id=150
/interface ethernet switch port
set ether1 vlan-header=add-if-missing vlan-mode=secure
set ether2 default-vlan-id=150 vlan-header=always-strip vlan-mode=secure
set ether3 default-vlan-id=50 vlan-header=always-strip vlan-mode=secure
set ether4 default-vlan-id=50 vlan-header=always-strip vlan-mode=secure
set ether5 default-vlan-id=50 vlan-header=always-strip vlan-mode=secure
set switch1-cpu vlan-mode=secure
/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
add bridge=bridge interface=OAM
/interface ethernet switch vlan
add independent-learning=yes ports=ether1,ether3,ether4,ether5 switch=switch1 vlan-id=50
add independent-learning=yes ports=ether1,ether2,switch1-cpu switch=switch1 vlan-id=150
/ip address
add address=192.168.0.70/24 interface=OAM network=192.168.0.0
/ip route
add distance=1 gateway=192.168.0.2
The funny thing is - if I replace the VLAN ID 150 with the ID 1 and configure an approriate IP address/gateway from the VLAN 1 subnet, I can’t connect to the switch anymore.
The only thing to let this work partially is replacing set switch1-cpu vlan-mode=secure by set switch1-cpu vlan-mode=disabled, then at least I can connect to the switch through VLAN 1 on the trunk interface (but not the access port ether2).
What am I missing and doing wrong here?
Cheers
spi