# feb/26/2023 19:28:03 by RouterOS 7.7
# software id = WF9L-WWN0
#
# model = C52iG-5HaxD2HaxD
# serial number = HD8084DXE24
/interface bridge
add admin-mac=18:FD:74:C2:9E:82 auto-mac=no comment=defconf igmp-snooping=yes \
name=bridge
/interface wifiwave2
set [ find default-name=wifi1 ] channel.band=5ghz-ax .skip-dfs-channels=\
10min-cac .width=20/40/80mhz configuration.mode=ap .ssid=mm14b-mk \
disabled=no security.authentication-types=wpa2-psk,wpa3-psk
set [ find default-name=wifi2 ] channel.band=2ghz-ax .frequency=2437 \
.skip-dfs-channels=10min-cac .width=20mhz configuration.mode=ap .ssid=\
mm14b-mk disabled=no security.authentication-types=wpa2-psk,wpa3-psk
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=internet \
use-peer-dns=yes user=adslppp@telefonicanetpa
/interface eoip
add local-address=172.17.0.2 mac-address=FE:25:77:82:07:62 mtu=1500 name=\
eoip-iptv remote-address=172.17.0.1 tunnel-id=0
/interface wireguard
add listen-port=12346 mtu=1420 name=wg-rw-ipad-spm
add listen-port=12345 mtu=1420 name=wg-rw-iphone-spm
add listen-port=54321 mtu=1420 name=wg-sts-iptv
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip dhcp-server option
add code=240 name=opch-imagenio value="':::::239.0.2.29:22222'"
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.239
add name=iptv-dhcp ranges=192.168.88.241-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp interface=bridge name=defconf
/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 comment=defconf interface=wifi1
add bridge=bridge comment=defconf interface=wifi2
add bridge=bridge interface=eoip-iptv
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add interface=internet list=WAN
/interface wireguard peers
add allowed-address=192.168.50.2/32 comment=iphone-spm interface=\
wg-rw-iphone-spm public-key=\
"KEY PUBLICA DEL IPHONE"
add allowed-address=192.168.60.2/32 comment=ipad-spm interface=wg-rw-ipad-spm \
public-key="KEY PUBLICA DEL IPAD"
add allowed-address=0.0.0.0/0 comment=map2nd endpoint-address=\
hcd07gnvjqc.sn.mynetname.net endpoint-port=54321 interface=wg-sts-iptv \
persistent-keepalive=25s public-key=\
"KEY PUBLICA DE PEPE"
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=\
192.168.88.0
add address=192.168.1.32/24 interface=ether1 network=192.168.1.0
add address=192.168.50.1/24 interface=wg-rw-iphone-spm network=192.168.50.0
add address=192.168.60.1/24 interface=wg-rw-ipad-spm network=192.168.60.0
add address=172.17.0.2/30 interface=wg-sts-iptv network=172.17.0.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-server lease
add address=192.168.88.3 client-id=1:c8:bc:c8:a1:92:f mac-address=\
C8:BC:C8:A1:92:0F server=defconf
add address=192.168.88.2 client-id=1:c:4d:e9:c9:5a:20 mac-address=\
0C:4D:E9:C9:5A:20 server=defconf
/ip dhcp-server matcher
add address-pool=iptv-dhcp code=60 name=deco server=defconf value="[IAL]"
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf dns-server=192.168.88.1 gateway=\
192.168.88.1
add address=192.168.88.240/28 comment=iptv-subnet dhcp-option=opch-imagenio \
dns-server=172.26.23.3 gateway=192.168.88.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.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=accept chain=input comment="multicast: allow from HGU" \
in-interface=ether1 protocol=igmp
add action=accept chain=input comment="vpn: allow wg-rw-iphone-spm" dst-port=\
12345 protocol=udp
add action=accept chain=input comment="vpn: allow wg-rw-ipad-spm" dst-port=\
12346 protocol=udp
add action=accept chain=input comment="vpn: allow wireguard gorron" dst-port=\
54321 protocol=udp
add action=accept chain=input comment="iptv: allow gre for eoip" \
in-interface=wg-sts-iptv protocol=gre
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
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
add action=src-nat chain=srcnat out-interface=ether1 to-addresses=\
192.168.1.32
/ip firewall service-port
set rtsp disabled=no
/ip route
add dst-address=10.31.255.128/27 gateway=192.168.1.1
add dst-address=172.23.0.0/16 gateway=192.168.1.1
add dst-address=172.26.0.0/16 gateway=192.168.1.1
/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
/routing igmp-proxy
set query-interval=30s quick-leave=yes
/routing igmp-proxy interface
add alternative-subnets=0.0.0.0/0 interface=ether1 upstream=yes
add interface=bridge
/system clock
set time-zone-name=Europe/Madrid
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN