# oct/23/2022 20:17:24 by RouterOS 7.6
# software id = Y3ZQ-0PU1
#
# model = RBD53iG-5HacD2HnD
# serial number = E72C0E5E0E7A
/caps-man channel
add band=2ghz-g/n control-channel-width=20mhz extension-channel=disabled \
frequency=2412 name=2ghz-ch01-20
add band=2ghz-g/n control-channel-width=20mhz extension-channel=disabled \
frequency=2437 name=2ghz-ch06-20
add band=2ghz-g/n control-channel-width=20mhz extension-channel=disabled \
frequency=2462 name=2ghz-ch11-20
add band=5ghz-n/ac control-channel-width=20mhz extension-channel=Ceee \
frequency=5180 name=5ghz-ch036-80
add band=5ghz-n/ac control-channel-width=20mhz extension-channel=Ceee \
frequency=5260 name=5ghz-ch052-80
add band=5ghz-n/ac control-channel-width=20mhz extension-channel=Ceee \
frequency=5500 name=5ghz-ch100-80
/interface bridge
add admin-mac=2C:C8:1B:A0:51:71 auto-mac=no comment=defconf frame-types=\
admit-only-vlan-tagged name=bridge vlan-filtering=yes
/interface wireless
# managed by CAPsMAN
# channel: 2412/20/gn(11dBm), SSID: Castillo, 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-A05175 wireless-protocol=802.11
# managed by CAPsMAN
# channel: 5500/20-Ceee/ac/DP(21dBm), SSID: Castillo, 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-A05176 wireless-protocol=802.11
/interface wireguard
add listen-port=5050 mtu=1420 name=wg-rw
/interface vlan
add interface=bridge name=vlan-domotica vlan-id=78
add interface=bridge name=vlan-home vlan-id=77
add arp=reply-only interface=bridge name=vlan-invitados vlan-id=79
/caps-man datapath
add bridge=bridge client-to-client-forwarding=yes name=home vlan-id=77 \
vlan-mode=use-tag
add bridge=bridge client-to-client-forwarding=no name=domotica vlan-id=78 \
vlan-mode=use-tag
add bridge=bridge client-to-client-forwarding=no name=invitados vlan-id=79 \
vlan-mode=use-tag
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=internet user=\
adslppp@telefonicanetpa
/caps-man security
add authentication-types=wpa2-psk encryption=aes-ccm group-encryption=aes-ccm \
name=home
add authentication-types=wpa2-psk encryption=aes-ccm group-encryption=aes-ccm \
name=domotica
add authentication-types=wpa2-psk encryption=aes-ccm group-encryption=aes-ccm \
name=invitados
/caps-man configuration
add channel=2ghz-ch01-20 channel.tx-power=14 country=spain datapath=home \
installation=indoor mode=ap name=2ghz-home-ap0 security=home ssid=\
Castillo
add channel=2ghz-ch06-20 channel.tx-power=14 country=spain datapath=home \
installation=indoor mode=ap name=2ghz-home-ap1 security=home ssid=\
Castillo
add channel=2ghz-ch11-20 country=spain datapath=home installation=indoor \
mode=ap name=2ghz-home-ap2 security=home ssid=Castillo
add channel=5ghz-ch100-80 country=spain datapath=home installation=indoor \
mode=ap name=5ghz-home-ap0 security=home ssid=Castillo
add channel=5ghz-ch036-80 country=spain datapath=home installation=indoor \
mode=ap name=5ghz-home-ap1 security=home ssid=Castillo
add channel=5ghz-ch052-80 country=spain datapath=home installation=indoor \
mode=ap name=5ghz-home-ap2 security=home ssid=Castillo
add country=spain datapath=domotica mode=ap name=domotica security=domotica \
ssid=Castillo_IOT
add country=spain datapath=invitados mode=ap name=invitados security=\
invitados ssid=Castillo_Invitados
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
add name=ISOLATED
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp-home ranges=192.168.77.10-192.168.77.254
add name=dhcp-domotica ranges=192.168.78.10-192.168.78.254
add name=dhcp-invitados ranges=192.168.79.10-192.168.79.254
/ip dhcp-server
add address-pool=dhcp-home interface=vlan-home name=dhcp-home
add address-pool=dhcp-domotica interface=vlan-domotica name=dhcp-domotica
add add-arp=yes address-pool=dhcp-invitados interface=vlan-invitados name=\
dhcp-invitados
/caps-man manager
set enabled=yes upgrade-policy=suggest-same-version
/caps-man manager interface
set [ find default=yes ] forbid=yes
add disabled=no interface=vlan-home
/caps-man provisioning
add action=create-dynamic-enabled comment=ac3-cfg-2ghz master-configuration=\
2ghz-home-ap0 name-format=prefix-identity name-prefix=2ghz radio-mac=\
2C:C8:1B:A0:51:75 slave-configurations=domotica,invitados
add action=create-dynamic-enabled comment=ac3-cfg-5ghz master-configuration=\
5ghz-home-ap0 name-format=prefix-identity name-prefix=5ghz radio-mac=\
2C:C8:1B:A0:51:76 slave-configurations=domotica,invitados
add action=create-dynamic-enabled comment=ac2-cfg-2ghz master-configuration=\
2ghz-home-ap1 name-format=prefix-identity name-prefix=2ghz radio-mac=\
DC:2C:6E:F6:08:B0 slave-configurations=domotica,invitados
add action=create-dynamic-enabled comment=ac2-cfg-5ghz master-configuration=\
5ghz-home-ap1 name-format=prefix-identity name-prefix=5ghz radio-mac=\
DC:2C:6E:F6:08:B1 slave-configurations=domotica,invitados
add action=create-dynamic-enabled comment=wAP-cfg-2ghz disabled=yes \
master-configuration=2ghz-home-ap2 name-format=prefix-identity \
name-prefix=2ghz radio-mac=AA:BB:CC:11:22:33 slave-configurations=\
domotica,invitados
add action=create-dynamic-enabled comment=wAP-cfg-5ghz disabled=yes \
master-configuration=5ghz-home-ap2 name-format=prefix-identity \
name-prefix=5ghz radio-mac=AA:BB:CC:11:22:34 slave-configurations=\
domotica,invitados
/interface bridge port
add bridge=bridge comment=defconf frame-types=\
admit-only-untagged-and-priority-tagged interface=ether2 pvid=77
add bridge=bridge comment=defconf frame-types=\
admit-only-untagged-and-priority-tagged interface=ether3 pvid=77
add bridge=bridge comment=defconf frame-types=\
admit-only-untagged-and-priority-tagged interface=ether4 pvid=77
add bridge=bridge comment=defconf frame-types=\
admit-only-untagged-and-priority-tagged interface=ether5 pvid=77
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge comment=defconf interface=wlan2
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface bridge vlan
add bridge=bridge comment=home tagged=bridge vlan-ids=77
add bridge=bridge comment=domotica tagged=bridge vlan-ids=78
add bridge=bridge comment=invitados tagged=bridge vlan-ids=79
/interface list member
add comment=defconf interface=internet list=WAN
add interface=vlan-home list=LAN
add interface=vlan-domotica list=ISOLATED
add interface=vlan-invitados list=ISOLATED
/interface wireguard peers
add allowed-address=192.168.76.2/32 comment=Joputi-Motorola-G4 interface=\
wg-rw public-key="dY12WTC1shFn9N9l6G0i8Hsk6u2D+1piFJRdDFKTjHg="
add allowed-address=192.168.76.2/32 comment=Nurosir-Poco disabled=yes \
interface=wg-rw public-key="rb/CMk5Rj0ZpGsvTSoRD3YvIDFbHV8xPgNVeFTAZHkM="
/interface wireless cap
#
set bridge=bridge caps-man-addresses=127.0.0.1 enabled=yes interfaces=\
wlan1,wlan2
/ip address
add address=192.168.77.1/24 interface=vlan-home network=192.168.77.0
add address=192.168.78.1/24 interface=vlan-domotica network=192.168.78.0
add address=192.168.79.1/24 interface=vlan-invitados network=192.168.79.0
add address=192.168.76.1/24 interface=wg-rw network=192.168.76.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-server lease
add address=192.168.77.248 client-id=1:bc:ae:c5:4:1a:c6 mac-address=\
BC:AE:C5:04:1A:C6 server=dhcp-home
add address=192.168.78.252 comment="Detector de GLP. SHelly" mac-address=\
48:3F:DA:1A:32:23 server=dhcp-domotica
add address=192.168.78.251 comment=\
"Sensor de inundaciones del ba\F1o de arriba.Shelly flood." mac-address=\
34:94:54:6F:4D:42 server=dhcp-domotica
add address=192.168.78.249 comment=\
"Sensor de temperatura del sal\F3n.Shelly H/T." mac-address=\
C4:5B:BE:77:FA:1F server=dhcp-domotica
add address=192.168.78.248 comment=\
"Sensor de inundaciones del Office. Shelly flood." mac-address=\
34:94:54:6F:43:05 server=dhcp-domotica
add address=192.168.78.247 client-id=ff:12:34:56:78:0:3:0:6:68:a4:e:2b:42:77 \
comment="Frigor\EDfico. Siemens" mac-address=68:A4:0E:2B:42:77 server=\
dhcp-domotica
add address=192.168.78.253 client-id=1:38:b4:d3:e2:10:c0 comment=\
"Lavavajillas Siemens" mac-address=38:B4:D3:E2:10:C0 server=dhcp-domotica
add address=192.168.77.240 comment=Proxmox mac-address=98:FA:9B:3E:4B:0B \
server=dhcp-home
add address=192.168.77.245 client-id=\
ff:5b:d7:67:31:0:1:0:1:2a:5b:23:31:72:60:5b:d7:67:31 comment=\
"Vserver 103. Speed-tester" mac-address=72:60:5B:D7:67:31 server=\
dhcp-home
add address=192.168.77.2 client-id=\
ff:7a:5d:d8:e6:0:1:0:1:2a:51:7f:95:26:c0:7a:5d:d8:e6 comment=\
"Vserver 101. Pi-hole" mac-address=26:C0:7A:5D:D8:E6 server=dhcp-home
add address=192.168.77.238 client-id=\
ff:31:8a:2b:cf:0:1:0:1:2a:65:a0:e6:da:b2:31:8a:2b:cf comment=\
"Vserver 105. Backup" mac-address=DA:B2:31:8A:2B:CF server=dhcp-home
add address=192.168.77.3 client-id=1:f2:3f:47:72:c1:f6 comment=\
"Vserver 102. Domotica-Alpine" mac-address=F2:3F:47:72:C1:F6 server=\
dhcp-home
add address=192.168.78.240 comment="Persiana fijo sal\F3n. Shelly 2.5" \
mac-address=E8:DB:84:A0:44:1A server=dhcp-domotica
add address=192.168.78.239 comment="Persiana puerta sal\F3n.Shelly 2.5" \
mac-address=E8:DB:84:A0:2E:ED server=dhcp-domotica
add address=192.168.78.238 comment="Persiana puerta cocina. Shelly 2.5" \
mac-address=E8:DB:84:A0:0C:4A server=dhcp-domotica
add address=192.168.78.237 comment="Persiana ventana cocina. Shelly 2.5" \
mac-address=E8:DB:84:A1:D4:43 server=dhcp-domotica
add address=192.168.78.236 comment="Persiana puerta salita. Shelly 2.5" \
mac-address=E8:DB:84:80:1C:25 server=dhcp-domotica
add address=192.168.78.235 comment="Persiana ventana salita. Shelly 2.5" \
mac-address=3C:61:05:E3:C6:EA server=dhcp-domotica
add address=192.168.78.234 client-id=1:cc:61:e5:53:5f:41 mac-address=\
CC:61:E5:53:5F:41 server=dhcp-domotica
add address=192.168.78.233 comment="Persiana dormitorio de abajo. Shelly 2.5" \
mac-address=E8:DB:84:A0:32:99 server=dhcp-domotica
add address=192.168.78.232 comment="Persiana ba\F1o de abajo. Shelly 2.5" \
mac-address=E8:DB:84:80:1D:64 server=dhcp-domotica
add address=192.168.78.231 comment="Foco del llano. Shelly 1" mac-address=\
98:CD:AC:2D:F0:B4 server=dhcp-domotica
add address=192.168.78.230 comment=\
"1.Luces del Llano. 2 Luces del muro. Shelly 2.5" mac-address=\
C4:5B:BE:6A:A1:0E server=dhcp-domotica
add address=192.168.78.229 comment="\BFLuces terraza de atras\? .Shelly 1" \
mac-address=98:CD:AC:2E:3B:4D server=dhcp-domotica
add address=192.168.78.250 comment=\
"Sensor de temperatura dormitorio principal. Shelly HT" mac-address=\
C4:5B:BE:78:6A:33 server=dhcp-domotica
add address=192.168.78.228 comment="Timbre. Luz de la calle. Shelly 2.5" \
mac-address=3C:61:05:E4:4E:9F server=dhcp-domotica
add address=192.168.78.227 comment=\
"Persiana dormitorio principal. Shelly 2.5" mac-address=E8:DB:84:AB:6D:2D \
server=dhcp-domotica
add address=192.168.78.226 comment="Persiana Office. Shelly 2.5" mac-address=\
E8:DB:84:80:27:B8 server=dhcp-domotica
add address=192.168.78.225 comment="Persiana Biblioteca calle. Shelly 2.5" \
mac-address=E8:DB:84:AB:DE:F2 server=dhcp-domotica
add address=192.168.78.224 comment="Persiana pasillo terraza. Shelly 2.5" \
mac-address=E8:DB:84:80:1E:6C server=dhcp-domotica
add address=192.168.78.223 comment=\
"Persiana dorrmitorio de arriba. Shelly 2.5" mac-address=\
E8:DB:84:A0:1C:49 server=dhcp-domotica
add address=192.168.78.221 comment="Persiana ba\F1o de arriba. Shelly 2.5" \
mac-address=E8:DB:84:80:1A:81 server=dhcp-domotica
add address=192.168.78.220 comment="Echo dot 3 Alexa Sal\F3n" mac-address=\
08:6A:E5:14:99:8A server=dhcp-domotica
add address=192.168.78.219 comment="Echo dot 3 Alexa biblioteca" mac-address=\
08:91:15:86:1F:F5 server=dhcp-domotica
add address=192.168.78.218 comment="Persiana llano biblioteca. Shelly 2.5" \
mac-address=E8:DB:84:A0:1F:16 server=dhcp-domotica
/ip dhcp-server network
add address=192.168.77.0/24 comment=home dns-server=192.168.77.2,192.168.77.1 \
gateway=192.168.77.1
add address=192.168.78.0/24 comment=domotica dns-server=192.168.78.1,8.8.8.8 \
gateway=192.168.78.1
add address=192.168.79.0/24 comment=invitados dns-server=192.168.77.2,8.8.8.8 \
gateway=192.168.79.1 netmask=32
/ip dns
set allow-remote-requests=yes servers=1.1.1.2,1.0.0.2
/ip dns static
add address=192.168.77.1 comment=defconf name=router.lan
add address=192.168.78.253 name=siemens-lava.domo
add address=192.168.78.252 name=shelly-gas.domo
add address=192.168.78.251 name=shelly-flood-1.domo
add address=192.168.78.250 name=shelly-ht-1.domo
add address=192.168.78.249 name=shelly-ht-2.domo
add address=192.168.78.248 name=shelly-flood-2.domo
add address=192.168.78.247 name=siemens-frigo.domo
add address=192.168.78.233 name=shelly-p1.domo
add address=192.168.78.232 name=shelly-p2.domo
add address=192.168.78.235 name=shelly-p3.domo
add address=192.168.78.236 name=shelly-p4.domo
add address=192.168.78.240 name=shelly-p5.domo
add address=192.168.78.239 name=shelly-p6.domo
add address=192.168.78.238 name=shelly-p7.domo
add address=192.168.78.237 name=shelly-p8.domo
add address=192.168.78.223 name=shelly-p9.domo
add address=192.168.78.221 name=shelly-p10.domo
add address=192.168.78.225 name=shelly-p11.domo
add address=192.168.78.222 name=shelly-p12.domo
add address=192.168.78.226 name=shelly-p13.domo
add address=192.168.78.224 name=shelly-p14.domo
add address=192.168.78.227 name=shelly-p15.domo
add address=192.168.78.230 name=shelly-l1.domo
add address=192.168.78.231 name=shelly-l2.domo
add address=192.168.78.229 name=shelly-l3.domo
add address=192.168.78.228 name=shelly-l4.domo
/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=accept chain=input comment="vpn: allow wireguard" dst-port=5050 \
protocol=udp
add action=accept chain=input comment="dns: allow domo to use dns" dst-port=\
53 in-interface=vlan-domotica protocol=udp
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 hw-offload=yes
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=accept chain=forward comment="vlans: guests can access Pi-Hole" \
dst-address=192.168.77.2 src-address=192.168.79.0/24
add action=accept chain=forward comment="vlans: domo can access HA" \
dst-address=192.168.77.3 src-address=192.168.78.0/24
add action=reject chain=forward comment="vlans: can only access internet" \
in-interface-list=ISOLATED out-interface-list=!WAN reject-with=\
icmp-network-unreachable
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
/ipv6 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 ICMPv6" protocol=\
icmpv6
add action=accept chain=input comment="defconf: accept UDP traceroute" port=\
33434-33534 protocol=udp
add action=accept chain=input comment=\
"defconf: accept DHCPv6-Client prefix delegation." dst-port=546 protocol=\
udp src-address=fe80::/10
add action=accept chain=input comment="defconf: accept IKE" dst-port=500,4500 \
protocol=udp
add action=accept chain=input comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=input comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=input comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=input comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
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 packets with bad src ipv6" src-address-list=bad_ipv6
add action=drop chain=forward comment=\
"defconf: drop packets with bad dst ipv6" dst-address-list=bad_ipv6
add action=drop chain=forward comment="defconf: rfc4890 drop hop-limit=1" \
hop-limit=equal:1 protocol=icmpv6
add action=accept chain=forward comment="defconf: accept ICMPv6" protocol=\
icmpv6
add action=accept chain=forward comment="defconf: accept HIP" protocol=139
add action=accept chain=forward comment="defconf: accept IKE" dst-port=\
500,4500 protocol=udp
add action=accept chain=forward comment="defconf: accept ipsec AH" protocol=\
ipsec-ah
add action=accept chain=forward comment="defconf: accept ipsec ESP" protocol=\
ipsec-esp
add action=accept chain=forward comment=\
"defconf: accept all that matches ipsec policy" ipsec-policy=in,ipsec
add action=drop chain=forward comment=\
"defconf: drop everything else not coming from LAN" in-interface-list=\
!LAN
/system clock
set time-zone-name=Europe/Madrid
/system identity
set name=AC3
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN