I have a Mikrotik HEX RouterOS device and several WiFi access points that are not VLAN aware. I would like to connect one access point to port 2 and one access point to port 3, and separate the networks but share the internet connection from port 1 (WAN).
From what I can find online, I have 2 options, I listed them below and included some config:
Use the physical ports to create 2 subnets (1 per port) and configure the firewall so the networks cannot access each other, something like:
/interface ethernet set
[ find default-name=ether1 ] name=WANset
[ find default-name=ether2 ] name=AP1set
[ find default-name=ether3 ] name=AP2
/ip address
add address=192.168.88.1/24 interface=AP1 comment="Subnet AP1"
add address=192.168.99.1/24 interface=AP2 comment="Subnet AP2"
/ip pool
add name=poolAP1 ranges=192.168.88.10-192.168.88.254
add name=poolAP2 ranges=192.168.99.10-192.168.99.254
/ip dhcp-server
add name=dhcpAP1 interface=AP1 address-pool=poolAP1 lease-time=1h
add name=dhcpAP2 interface=AP2 address-pool=poolAP2 lease-time=1h
/ip dhcp-server network
add address=192.168.88.0/24 gateway=192.168.88.1 dns-server=192.168.88.1
add address=192.168.99.0/24 gateway=192.168.99.1 dns-server=192.168.99.1
/ip firewall nat
add chain=srcnat out-interface=WAN action=masquerade
/ip firewall filter
add chain=forward src-address=192.168.88.0/24 dst-address=192.168.99.0/24 action=drop
add chain=forward src-address=192.168.99.0/24 dst-address=192.168.88.0/24 action=drop
add chain=forward in-interface=AP1 out-interface=WAN action=accept
add chain=forward in-interface=AP2 out-interface=WAN action=accept
add chain=forward action=drop
Or create 2 port-based VLANS separated by firewall rules, like:
/interface ethernet
set [ find default-name=ether1 ] name=WAN
set [ find default-name=ether2 ] name=AP1
set [ find default-name=ether3 ] name=AP2
/interface bridge
add name=br-lan vlan-filtering=yes
/interface bridge port
add bridge=br-lan interface=ether2 pvid=88 comment="AP1 -> VLAN88"
add bridge=br-lan interface=ether3 pvid=99 comment="AP2 -> VLAN99"
/interface vlan
add interface=br-lan name=vlan88 vlan-id=88
add interface=br-lan name=vlan99 vlan-id=99
/ip address
add address=192.168.88.1/24 interface=vlan88 comment="Subnet AP1"
add address=192.168.99.1/24 interface=vlan99 comment="Subnet AP2"
/ip pool
add name=pool88 ranges=192.168.88.10-192.168.88.254
add name=pool99 ranges=192.168.99.10-192.168.99.254
/ip dhcp-server
add name=dhcp88 interface=vlan88 address-pool=pool88 lease-time=1h
add name=dhcp99 interface=vlan99 address-pool=pool99 lease-time=1h
/ip dhcp-server network
add address=192.168.88.0/24 gateway=192.168.88.1 dns-server=192.168.88.1
add address=192.168.99.0/24 gateway=192.168.99.1 dns-server=192.168.99.1
/ip firewall nat
add chain=srcnat out-interface=WAN action=masquerade
/ip firewall filter
add chain=forward src-address=192.168.88.0/24 dst-address=192.168.99.0/24 action=drop comment="Block VLAN88 -> VLAN99"
add chain=forward src-address=192.168.99.0/24 dst-address=192.168.88.0/24 action=drop comment="Block VLAN99 -> VLAN88"
add chain=forward in-interface=vlan88 out-interface=WAN action=accept comment="VLAN88 → internet"
add chain=forward in-interface=vlan99 out-interface=WAN action=accept comment="VLAN99 → internet"
add chain=forward action=drop comment="Drop other forward traffic"
Would both options work, and which option would you prefer?