One bridge many vlans........... Done.
Thank you for answering anav. Sorry this is not so obvious for me. Don't I need DHCP relay on APs ?
What I did until now
On main router RT2
Create the VLANs and different bridges for etch one.
If I create one bridge isn't this end up to communicate to each other? I don't exactly want this. I want guest and smart devices communicate with Internet only.
/interface bridge
add admin-mac=DC:2C:6E:5E:71:07 auto-mac=no comment=defconf name=bridge
add name=bridge-guest
add comment="smart devices bridge" name=bridge-sd
/interface vlan
add comment="guest vlan" interface=ether2 name=vlan1 vlan-id=1
add comment="Smart Devices VLAN" interface=ether2 name=vlan2 vlan-id=2
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge-guest interface=wlan1
add bridge=bridge comment=defconf interface=wlan2
add bridge=bridge-guest interface=vlan1
add bridge=bridge-sd interface=vlan2
Give different IP to each bridge
/ip address
add address=10.10.0.1/16 interface=bridge network=10.10.0.0
add address=192.168.1.2/29 comment=WAN interface=ether1 network=192.168.1.0
add address=10.1.0.1/16 interface=bridge-guest network=10.1.0.0
add address=10.2.0.1/16 interface=bridge-sd network=10.2.0.0
Add the DHCP Servers
/ip dhcp-server
add address-pool=10.10.0.2-254 disabled=no interface=bridge lease-time=1h name=local
add address-pool=10.1.0.2-254 disabled=no interface=bridge-guest name=guest
add address-pool=10.2.0.2-254 disabled=no interface=bridge-sd lease-time=1d name="smart devces"
/ip dhcp-server network
add address=10.1.0.0/16 dns-server=8.8.8.8,192.168.1.1 gateway=10.1.0.1
add address=10.2.0.0/16 dns-server=8.8.8.8,192.168.1.1 gateway=10.2.0.1
add address=10.10.0.0/24 dns-server=8.8.8.8,192.168.1.1 gateway=10.10.0.1
Setup the wireless
In the area of my main router(RT2) I don't need to connect smart devices so I let 2.4Ghz for guests and 5GHz for private network.
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge security-profile=profile-guest ssid=guest wireless-protocol=802.11 wps-mode=disabled
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=20/40/80mhz-XXXX disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge security-profile=profile-private ssid=pv wireless-protocol=802.11 wps-mode=disabled
Access Points AP1 and AP2
Just starting from AP1. I will setup AP2 with export when AP1 work fine.
VLAN and bridges
/interface bridge
add admin-mac=DC:2C:6E:E4:DE:D7 auto-mac=no comment=defconf name=bridge
/interface bridge port
add bridge=bridge comment=defconf interface=pwr-line1
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge interface=ether1
Setup the wireless
Use main wirless interface for my pv network and create 2 virtual for guest and smart devices. I am willing to create a wifi mesh but now for testing purposes add some numbers.
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX country=greece disabled=no distance=indoors frequency=auto installation=indoor mode=ap-bridge security-profile=profile-private ssid=pv1 wireless-protocol=802.11 wps-mode=disabled
add disabled=no keepalive-frames=disabled mac-address=DE:2C:6E:E4:DE:D8 master-interface=wlan1 multicast-buffering=disabled name=wlan2 security-profile=profile-guest ssid=guest1 wds-cost-range=0 wds-default-cost=0 wps-mode=disabled
add disabled=no keepalive-frames=disabled mac-address=DE:2C:6E:E4:DE:D9 master-interface=wlan1 multicast-buffering=disabled name=wlan3 security-profile=profile-sd ssid=sd wds-cost-range=0 wds-default-cost=0 wps-mode=disabled
Create a DHCP client for AP
I prefer to lease IP of every device on main router so for easy config
/ip dhcp-client
add comment=defconf disabled=no interface=bridge
DHCP Relays
I am not sure that I have understand completely the Relays role. I use them in order to route the traffic to correct DHCP according to wireless interface.
/ip dhcp-relay
add dhcp-server=10.1.0.1 disabled=no interface=wlan2 name="guest DHCP relay"
add dhcp-server=10.2.0.1 disabled=no interface=wlan3 name="sd DHCP relay"
add dhcp-server=10.10.0.1 disabled=no interface=wlan1 name="private DHCP relay"
Testing DHCP
Using my phone trying to test DHCP and the results are bellow
- RT2 - pv CHECK
RT2 - guest CHECK
AP1 - pv CHECK
AP1 - guest FAIL(Obdaining IP Adress)
AP1 - sd FAIL(Obdaining IP Adress)