# oct/17/2021 13:42:25 by RouterOS 6.49
# software id = 5AAQ-09TH
#
# model = RBD53iG-5HacD2HnD
/caps-man channel
add band=2ghz-g/n control-channel-width=20mhz extension-channel=disabled \
frequency=2412,2437,2462 name=2ghz-auto-20
add band=5ghz-n/ac control-channel-width=20mhz extension-channel=XXXX name=\
5ghz-auto-80
/interface bridge
add name=bridge-guests
add admin-mac=2C:C8:1B:C7:A3:F3 auto-mac=no comment=defconf name=bridge-lan
/interface wireless
# managed by CAPsMAN
# channel: 2412/20/gn(17dBm), SSID: HARITZ, CAPsMAN forwarding
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-XX \
distance=indoors frequency=auto installation=indoor mode=ap-bridge ssid=\
MikroTik-C7A3F7 wireless-protocol=802.11
# managed by CAPsMAN
# channel: 5700/20-eeeC/ac/DP(21dBm), SSID: HARITZ, CAPsMAN forwarding
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=\
20/40/80mhz-XXXX distance=indoors frequency=auto installation=indoor \
mode=ap-bridge ssid=MikroTik-C7A3F8 wireless-protocol=802.11
/interface vlan
add interface=ether1 name=vlan24 vlan-id=24
/caps-man datapath
add bridge=bridge-guests client-to-client-forwarding=no local-forwarding=no \
name=datapath-guests
add bridge=bridge-lan client-to-client-forwarding=yes local-forwarding=no \
name=datapath-lan
/interface pppoe-client
add add-default-route=yes disabled=no interface=vlan24 max-mru=1492 max-mtu=\
1492 name=pppoe-out1 password=PASSWORD use-peer-dns=yes user=\
USER
/caps-man security
add authentication-types=wpa2-psk encryption=aes-ccm group-encryption=aes-ccm \
name=security-profile-guests passphrase=PASSWORD
add authentication-types=wpa2-psk encryption=aes-ccm group-encryption=aes-ccm \
name=security-profile-lan passphrase=PASSWORD
/caps-man configuration
add channel=2ghz-auto-20 country=spain datapath=datapath-lan mode=ap name=\
2ghz-wifi-lan security=security-profile-lan ssid=HARITZ
add channel=5ghz-auto-80 country=spain datapath=datapath-lan mode=ap name=\
5ghz-wifi-lan security=security-profile-lan ssid=HARITZ
add channel=2ghz-auto-20 country=spain datapath=datapath-guests mode=ap name=\
2ghz-wifi-guests security=security-profile-guests ssid=GONBIDATUAK
add channel=5ghz-auto-80 country=spain datapath=datapath-guests mode=ap name=\
5ghz-wifi-guests security=security-profile-guests ssid=GONBIDATUAK
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp ranges=172.21.200.0/24
add name=pool-guests ranges=192.168.99.2-192.168.99.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge-lan name=defconf
add address-pool=pool-guests disabled=no interface=bridge-guests name=\
dhcp-guests
/caps-man manager
set ca-certificate=auto certificate=auto enabled=yes \
require-peer-certificate=yes
/caps-man manager interface
set [ find default=yes ] forbid=yes
add disabled=no interface=bridge-lan
/caps-man provisioning
add action=create-dynamic-enabled comment=2ghz-auto-provisioning \
hw-supported-modes=gn master-configuration=2ghz-wifi-lan name-format=\
prefix-identity name-prefix=2ghz-auto slave-configurations=\
2ghz-wifi-guests
add action=create-dynamic-enabled comment=5ghz-auto-provisioning \
hw-supported-modes=ac master-configuration=5ghz-wifi-lan name-format=\
prefix-identity name-prefix=5ghz-auto slave-configurations=\
5ghz-wifi-guests
/interface bridge port
add bridge=bridge-lan comment=defconf interface=ether2
add bridge=bridge-lan comment=defconf interface=ether3
add bridge=bridge-lan comment=defconf interface=ether4
add bridge=bridge-lan comment=defconf interface=ether5
add bridge=bridge-lan comment=defconf interface=wlan1
add bridge=bridge-lan comment=defconf interface=wlan2
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge-lan list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=pppoe-out1 list=WAN
/interface wireless cap
#
set bridge=bridge-lan caps-man-addresses=127.0.0.1 certificate=\
CAP-2CC81BC7A3F2 enabled=yes interfaces=wlan1,wlan2 lock-to-caps-man=yes
/ip address
add address=172.21.0.1/16 comment=defconf interface=bridge-lan network=\
172.21.0.0
add address=192.168.99.1/24 interface=bridge-guests network=192.168.99.0
/ip dhcp-client
add comment=defconf disabled=no interface=ether1
/ip dhcp-server network
add address=172.21.0.0/16 comment=defconf dns-server=172.21.0.1 gateway=\
172.21.0.1 netmask=16
add address=192.168.99.0/24 gateway=192.168.99.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip dns static
add address=172.21.0.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=accept chain=forward comment=\
"defconf: accept established,related, untracked" connection-state=\
established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
add action=drop chain=forward comment="block guests accesing LAN" \
dst-address=172.21.0.0/16 src-address=192.168.99.0/24
add action=drop chain=forward comment="block LAN accesing guests" \
dst-address=192.168.99.0/24 src-address=172.21.0.0/16
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=dst-nat chain=dstnat dst-port=8081 in-interface=pppoe-out1 \
protocol=tcp to-addresses=172.21.0.200 to-ports=8081
add action=dst-nat chain=dstnat dst-port=16001 in-interface=pppoe-out1 \
protocol=tcp to-addresses=172.21.0.200 to-ports=16001
add action=dst-nat chain=dstnat dst-port=8001 in-interface=pppoe-out1 \
protocol=tcp to-addresses=172.21.0.200 to-ports=8001
add action=dst-nat chain=dstnat dst-port=8002 in-interface=pppoe-out1 \
protocol=tcp to-addresses=172.21.0.200 to-ports=8002
add action=dst-nat chain=dstnat dst-port=21 in-interface=pppoe-out1 protocol=\
tcp to-addresses=172.21.0.200 to-ports=21
/system clock
set time-zone-name=Europe/Madrid
/system identity
set name=Router
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN