I'm trying to set up the following VLANs:
VLANS
- CAM_VLAN - no internet access, no access to other VLANs
- IOT_VLAN - full internet, no access to other VLANs
- MEDIA _VLAN - full internet, limited access to other VLANs (one specific IP in VLAN04 and relevant ports)
- MAIN_VLAN - full internet, full access to other VLANs
ROUTER PORTS
- Port 1 - WAN
- Port 2 - MAIN_VLAN
- Port 3 - MAIN_VLAN
- Port 4 - AP : MAIN_VLAN/IOT_VLAN
- Port 5 - AP : MAIN_VLAN/IOT_VLAN
- Port 6 - AP : MAIN_VLAN/IOT_VLAN
- Port 7 - MEDIA _VLAN
- Port 8 - CAM_VLAN
The APs will have 2 SSIDs (one for MAIN_VLAN, one for IOT_VLAN). I'll also set up VLAN tagging.
This is what I've got so far. I haven't tested it yet, because I currently have a working, but suboptimal config, and I'm afraid of completely killing my network. I do know that I am missing things.
Code: Select all
/interface bridge
add name=bridge1
/interface vlan
add interface=bridge1 name=cam_vlan vlan-id=10
add interface=bridge1 name=iot_vlan vlan-id=20
add interface=bridge1 name=media_vlan vlan-id=30
add interface=bridge1 name=main_vlan vlan-id=40
/ip address
add address=192.168.1.1/24 interface=cam_vlan network=192.168.1.0
add address=192.168.2.1/24 interface=iot_vlan network=192.168.2.0
add address=192.168.3.1/24 interface=media_vlan network=192.168.3.0
add address=192.168.4.1/24 interface=main_vlan network=192.168.4.0
/ip pool
add name=dhcp_pool1 ranges=192.168.1.100-192.168.1.199
add name=dhcp_pool2 ranges=192.168.2.100-192.168.2.199
add name=dhcp_pool3 ranges=192.168.3.100-192.168.3.199
add name=dhcp_pool4 ranges=192.168.4.100-192.168.4.199
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=cam_vlan name=dhcp1
add address-pool=dhcp_pool2 disabled=no interface=iot_vlan name=dhcp2
add address-pool=dhcp_pool3 disabled=no interface=media_vlan name=dhcp3
add address-pool=dhcp_pool4 disabled=no interface=main_vlan name=dhcp4
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=1.1.1.1 gateway=192.168.1.1
add address=192.168.2.0/24 dns-server=1.1.1.1 gateway=192.168.2.1
add address=192.168.3.0/24 dns-server=1.1.1.1 gateway=192.168.3.1
add address=192.168.4.0/24 dns-server=1.1.1.1 gateway=192.168.4.1
/ip dns
set allow-remote-requests=yes
/interface bridge port
add bridge=bridge1 interface=ether1
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
add bridge=bridge1 interface=ether6
add bridge=bridge1 interface=ether7
add bridge=bridge1 interface=ether8
/interface bridge
set bridge1 vlan-filtering=yes
/ip firewall filter
add action=drop chain=forward in-interface=cam_vlan out-interface=WAN
add action=accept chain=forward in-interface=media_vlan dst-address=192.168.04.17 dst-port=1900 protocol=udp
add action=accept chain=forward in-interface=media_vlan dst-address=192.168.04.17 dst-port=8096 protocol=tcp
add action=accept chain=forward in-interface=media_vlan dst-address=192.168.04.17 dst-port=8920 protocol=tcp
/ip dhcp-client
add disabled=no interface=ether1