Routerboard hAP Lite - Simple VLAN setup for UniFi APs

Hi,

I’ve just bought a Routerboard hAP Lite and trying to create a simple VLAN setup.

What I’m trying to achieve is…

Port 1 - WAN
Port 2 - Internal network, Windows DHCP server
Port 3 - UniFi APs with 2 SSIDs

The APs will have 2 SSIDs…

  • Internal SSID linked to internal dhcp and radius server
  • Guest SSID (inetrnet only) linked to DHCP on Mikrotik router and not routeable to internal network.

I would like the APs themselves to get a DHCP address from the internal network for management and the Internal SSID would need to have access to the internal network for radius authentication and DHCP.

The APs would be connected to an unmanaged switch and then an uplink to Port 3 on the router.
The inetrnal network switch is also unmanaged and would have an uplink to Port 2 on the router.

I understand that the Guest SSID needs a VLAN tag

Hope this makes sense and any advice would be helpful in the form of steps rather than command line.

Thanks in advance :astonished:)

Hi,
From my point of view you do not need the VLAN in your setup. You can do it different, with what is called VRF-Lite(well very close to it :smiley: ). In Mikrotik words its all about routing marks.Check this topic out, http://forum.mikrotik.com/t/inter-vrf-connectivity-issue/38496/1 maybe it will fit your needs.

Sorry for the delay in replying.

I sorted this by creating a single VLAN for the guest SSID. The APs are on the internal network but the guest SSID has a VLAN tag and get a DHCP address from the router and not the internal DHCP server.

I created a rule to drop traffic from the VLAN to the internal IP range and all is working as planned.

Even on unmanaged switches, the traffic is passed to the VLAN on the router.

Did you get this setup working? I have a similar setup but am having issues with it. If yours is working, would you mind posting a trimmed version of your config? Thank you.

/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-Ce
distance=indoors frequency=auto l2mtu=1600 mode=ap-bridge rx-chains=0,1
ssid=MikroTik-8AFE05 tx-chains=0,1 wireless-protocol=802.11
/interface ethernet
set [ find default-name=ether2 ] name=Port2-Internal
set [ find default-name=ether3 ] name=Port3
set [ find default-name=ether4 ] name=Port4
set [ find default-name=ether1 ] name=ether1-gateway
/ip neighbor discovery
set ether1-gateway discover=no
/interface vlan
add interface=Port2-Internal l2mtu=1594 name=Guest-VLAN vlan-id=100
/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
add name=Guest-VLAN-Pool ranges=10.0.0.100-10.0.0.200
/ip dhcp-server
add address-pool=dhcp name=default
add address-pool=Guest-VLAN-Pool disabled=no interface=Guest-VLAN lease-time=
1h name=Guest-VLAN-DHCP
/interface pppoe-client
add ac-name=“” add-default-route=yes allow=pap,chap,mschap1,mschap2
default-route-distance=1 dial-on-demand=no disabled=no interface=
ether1-gateway keepalive-timeout=60 max-mru=1480 max-mtu=1480 mrru=
disabled name=pppoe-out1 password= profile=default
service-name=“” use-peer-dns=yes user=
/interface bridge port
add interface=Port2-Internal
/ip addressce=wlan1
add address=192.168.0.1/24 comment=“default configuration” interface=
Port2-Internal network=192.168.0.0
add address=10.0.0.1/24 interface=Guest-VLAN network=10.0.0.0
/ip dhcp-client
add comment=“default configuration” dhcp-options=hostname,clientid disabled=
no interface=ether1-gateway
/ip dhcp-server network
add address=10.0.0.0/24 dns-server=10.0.0.1 gateway=10.0.0.1 netmask=24
add address=192.168.88.0/24 comment=“default configuration” gateway=
192.168.88.1
/ip dns
set allow-remote-requests=yes servers=208.67.222.222,208.67.220.220
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add action=drop chain=forward dst-address=192.168.0.0/24 src-address=
10.0.0.0/24
add action=drop chain=input in-interface=pppoe-out1 protocol=icmp
add action=drop chain=input dst-port=80 in-interface=pppoe-out1 protocol=tcp
add action=drop chain=input dst-port=2000 in-interface=pppoe-out1 protocol=
tcp
add chain=input comment=“default configuration” disabled=yes protocol=icmp
add chain=input comment=“default configuration” connection-state=
established,related
add action=drop chain=input comment=“default configuration” in-interface=
ether1-gateway
add chain=forward comment=“default configuration” connection-state=
established,related
add action=drop chain=forward comment=“default configuration”
connection-state=invalid
add action=drop chain=forward comment=“default configuration”
connection-nat-state=!dstnat connection-state=new in-interface=
ether1-gateway
/ip firewall nat
add action=masquerade chain=srcnat comment=“default configuration”
out-interface=pppoe-out1
add action=dst-nat chain=dstnat dst-port=5000 in-interface=pppoe-out1
protocol=tcp src-address= to-addresses=192.168.0.15
to-ports=5000
add action=dst-nat chain=dstnat disabled=yes in-interface=pppoe-out1
protocol=tcp to-addresses=192.168.0.25 to-ports=8888
add action=dst-nat chain=dstnat dst-port=5090 in-interface=pppoe-out1
protocol=tcp to-addresses=192.168.0.15 to-ports=5090
add action=dst-nat chain=dstnat dst-port=5090 in-interface=pppoe-out1
protocol=udp to-addresses=192.168.0.15 to-ports=5090
add action=dst-nat chain=dstnat disabled=yes dst-port=5060 in-interface=
pppoe-out1 protocol=tcp to-addresses=192.168.0.15 to-ports=5060
add action=dst-nat chain=dstnat disabled=yes dst-port=5060 in-interface=
pppoe-out1 protocol=udp src-address= to-addresses=
192.168.0.15 to-ports=5060
add action=dst-nat chain=dstnat disabled=yes dst-port=5060 in-interface=
pppoe-out1 protocol=udp src-address= to-addresses=
192.168.0.15
add action=dst-nat chain=dstnat dst-port=9000-9255 in-interface=pppoe-out1
protocol=udp to-addresses=192.168.0.15 to-ports=9000-9255