ZeroByte, I appreciate your help. Idlemind, I have come to see it your way and gave up on client isolation, settling for keeping the guests on an isolated subnet instead.
I was confused by the documentation at Wiki:Manual:Switch Chip Features and the error messages I got from
/interface ethernet switch port
. The switch chip on the hEX does not support VLAN tagging and I didn’t see where else to set it. Now I see that I need to use
/interface vlan
instead of
/interface ethernet switch vlan
and the tagging is implied by the VLAN interface (tags are added on ingress to the VLAN and only stripped when the packet is forwarded out of the VLAN) and handled by some other hardware.
Once I gave up on true client isolation, everything got much, much easier. Starting with the default “router” config which has NAT set up, I just need to add:
/interface ethernet
set [ find default-name=ether1 ] name=ether1-WAN
set [ find default-name=ether2 ] name=ether2-office-master
/interface vlan
add interface=ether2-office-master name=guest-wifi vlan-id=100
/ip address
add address=192.168.88.1/24 comment="Office router" interface=ether2-office-master network=192.168.88.0
add address=192.168.44.1/24 comment="Guest router" interface=guest-wifi network=192.168.44.0
/ip pool
add name=office_dchp-pool ranges=192.168.88.10-192.168.88.254
add name=guest_dhcp-pool ranges=192.168.44.10-192.168.44.254
/ip dhcp-server
add address-pool=office_dchp-pool disabled=no interface=ether2-office-master lease-time=3d10m name=dhcp-office
add address-pool=guest_dhcp-pool disabled=no interface=guest-wifi lease-time=3h name=dhcp-guest
/ip dhcp-server network
add address=192.168.88.0/24 comment="Office net" dns-server=8.8.8.8,8.8.4.4 gateway=192.168.88.1
add address=192.168.44.0/24 comment="Guest net" dns-server=8.8.8.8,8.8.4.4 gateway=192.168.44.1
# Of course the filters below have to be put in the right place in the chain, but I don't want to post the whole chain.
/ip firewall filter
add action=drop chain=forward comment="block guests -> office" in-interface=guest-wifi out-interface=ether2-office-master
add action=drop chain=forward comment="block office -> guests" in-interface=ether2-office-master out-interface=guest-wifi
This sets up ether2 as a hybrid connection, carrying the Office net untagged and the Guest WiFi tagged for VLAN 100. So ether2 is all I need to connect to my L2 switch; all the WAPs can also get plugged into the switch and I can use the switch’s VLAN management to keep the guest traffic isolated from the rest of the office. The firewall rules are needed because both subnets need to be routed to the WAN port, at which point the router will route the traffic from one subnet to the other.
Side note: It’s kind of annoying that there is no symbolic way to specify the DHCP network from the IP address list; I have to enter the same information in 2 places and keep it in sync. And of course I have to do all the DHCP and firewall filters over again for IPv6. Which brings us to the question I asked elsewhere, how do I distribute my IPv6 prefix into 2 isolated subnets…
/ipv6 dhcp-client
add add-default-route=yes comment="delgate ISP-assigned prefix" interface=ether1-WAN pool-name=wan6-pool prefix-hint=::/56 request=prefix
/ipv6 dhcp-server
add address-pool=wan6-pool comment="office addresses" interface=ether2-office-master name=office
add address-pool=wan6-pool comment="Guest WiFi addresses" interface=guest-wifi lease-time=3h name=guest
/ipv6 address
add comment="Office subnet" from-pool=wan6-pool interface=ether2-office-master
add comment="Guest subnet" from-pool=wan6-pool interface=guest-wifi
# Of course the filters below have to be put in the right place in the chain, but I don't want to post the whole chain.
/ipv6 firewall filter
add action=drop chain=forward comment="block guests -> office" in-interface=guest-wifi out-interface=ether2-office-master
add action=drop chain=forward comment="block office -> guests" in-interface=ether2-office-master out-interface=guest-wifi
I hope this helps someone. I imagine it’s a pretty common setup.