I’ve just purchased a CCR2116 which I want to replace my pfSense router with.
- primary WAN (dhcp) is not connected yet (sfp1-xgspon)
- backup WAN (dhcp) is connected to ether3
- LAN is connected over a trunk on 2 aggregated ports ether1 and ether2 to my unifi switch network
What I’ve noticed:
- DHCP client is working for WAN. Default route is being created.
- Inter VLAN routing is working.
- MACVLan rules for mdns are also working
- The router can ping internet and can resolve DNS
- Clients on vlan10 can resolve DNS using the router as dns server
- Clients on vlan10 can not access the internet (http/https), nor can they ping 1.1.1.1
I’ve tried, without avail:
- disabling all drop rules on the firewall
- pointing towards the ether3 interface directly instead of using the WAN interface list
- upgrading to 7.17beta2. Now running 7.16 again
- I even asked chatgpt what was wrong with the config…
Any idea what stupid small thing I’m missing?
Thx!
Config:
/interface bridge
add name=bridge priority=0 vlan-filtering=yes
add name=bridge-mdns protocol-mode=none
/interface ethernet
set [ find default-name=ether1 ] name=ether1-lag-trunk
set [ find default-name=ether2 ] name=ether2-lag-trunk
set [ find default-name=ether3 ] name=ether3-wan-backup
set [ find default-name=ether13 ] name=ether13-localmanagement
set [ find default-name=sfp-sfpplus1 ] name=sfp1-xgspon
set [ find default-name=sfp-sfpplus4 ] name=sfp4-server-trunk
/interface vlan
add interface=bridge name=vlan1-management vlan-id=1
add interface=bridge name=vlan5-iot vlan-id=5
add interface=bridge name=vlan6-cameras vlan-id=6
add interface=bridge name=vlan9-iotonline vlan-id=9
add interface=bridge name=vlan10-lan vlan-id=10
add interface=bridge name=vlan15-wifiguests vlan-id=15
/interface macvlan
add interface=vlan5-iot mac-address=6A:95:4C:51:4D:B0 mode=private name=macvlan5-iot
add interface=vlan6-cameras mac-address=8E:33:47:CE:8C:E3 mode=private name=macvlan6-cameras
add interface=vlan9-iotonline mac-address=6E:FB:2B:AE:07:E5 mode=private name=macvlan9-iotonline
add interface=vlan10-lan mac-address=4E:CD:E3:3E:B1:FF mode=private name=macvlan10-lan
/interface bonding
add mode=802.3ad name=lag-trunk slaves=ether1-lag-trunk,ether2-lag-trunk
/interface list
add name=LAN
add name=ManagementAllowed
add name=WAN
/ip dhcp-server option
add code=43 name="Unifi adopt" value=0x0104c0a805d2
/ip pool
add name=pool-lan-dhcp ranges=192.168.10.2-192.168.10.99
add name=pool-iot-dhcp ranges=192.168.8.2-192.168.8.99
add name=pool-cameras-dhcp ranges=192.168.6.2-192.168.6.99
add name=pool-wifiguests-dhcp ranges=192.168.15.2-192.168.15.99
add name=pool-iotonline-dhcp ranges=192.168.9.2-192.168.9.99
add name=pool-management-dhcp ranges=192.168.5.2-192.168.5.99
add name=pool-ipsec-dhcp ranges=192.168.20.2-192.168.20.99
/ip dhcp-server
add address-pool=pool-lan-dhcp interface=vlan10-lan lease-time=2h name=dhcp-vlan10-lan
add address-pool=pool-iot-dhcp interface=vlan5-iot lease-time=2h name=dhcp-vlan5-iot
add address-pool=pool-cameras-dhcp disabled=yes interface=vlan6-cameras lease-time=2h name=dhcp-vlan6-cameras
add address-pool=pool-wifiguests-dhcp interface=vlan15-wifiguests lease-time=2h name=dhcp-vlan15-wifiguests
add address-pool=pool-iotonline-dhcp interface=vlan9-iotonline lease-time=2h name=dhcp-vlan9-iotonline
add address-pool=pool-management-dhcp interface=vlan1-management lease-time=2h name=dhcp-vlan1-management
/port
set 0 name=serial0
/interface bridge filter
add action=accept chain=forward comment="1. Allow mDNS queries from vlan10-lan" dst-address=224.0.0.251/32 dst-mac-address=01:00:5E:00:00:FB/FF:FF:FF:FF:FF:FF dst-port=5353 in-interface=\
macvlan10-lan ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns src-port=5353
add action=accept chain=forward comment="2. Allow mDNS replies to vlan10-lan" dst-address=224.0.0.251/32 dst-mac-address=01:00:5E:00:00:FB/FF:FF:FF:FF:FF:FF dst-port=5353 in-bridge=\
bridge-mdns ip-protocol=udp mac-protocol=ip out-interface=macvlan10-lan src-port=5353
add action=drop chain=forward comment="3. Drop mDNS queries from other VLANs" disabled=yes dst-address=224.0.0.251/32 dst-mac-address=01:00:5E:00:00:FB/FF:FF:FF:FF:FF:FF dst-port=5353 \
in-bridge=bridge-mdns ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns src-port=5353
add action=accept chain=forward comment="Allow mDNS only" disabled=yes dst-address=224.0.0.251/32 dst-mac-address=01:00:5E:00:00:FB/FF:FF:FF:FF:FF:FF dst-port=5353 in-bridge=bridge-mdns \
ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns src-port=5353
add action=accept chain=forward comment="1. Allow SSDP queries from vlan10-lan" dst-address=239.255.255.250/32 dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF dst-port=1900 in-interface=\
macvlan10-lan ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns
add action=accept chain=forward comment="2. Allow SSDP replies to vlan10-lan" dst-address=239.255.255.250/32 dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF dst-port=1900 in-bridge=\
bridge-mdns ip-protocol=udp mac-protocol=ip out-interface=macvlan10-lan
add action=drop chain=forward comment="3. Drop SSDP queries from other VLANs" disabled=yes dst-address=239.255.255.250/32 dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF dst-port=1900 \
in-bridge=bridge-mdns ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns
add action=accept chain=forward comment="Forward SSDP" disabled=yes dst-address=239.255.255.250/32 dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF dst-port=1900 in-bridge=bridge-mdns \
ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns
add action=accept chain=forward comment="1. Allow Sonos queries from vlan10-lan" dst-address=239.255.255.250/32 dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF dst-port=1902 \
in-interface=macvlan10-lan ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns
add action=accept chain=forward comment="2. Allow Sonos replies to vlan10-lan" dst-address=239.255.255.250/32 dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF dst-port=1902 in-bridge=\
bridge-mdns ip-protocol=udp mac-protocol=ip out-interface=macvlan10-lan
add action=drop chain=forward comment="3. Drop Sonos queries from other VLANs" disabled=yes dst-address=239.255.255.250/32 dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF dst-port=1902 \
in-bridge=bridge-mdns ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns
add action=accept chain=forward comment="Forward Sonos" disabled=yes dst-address=239.255.255.250/32 dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF dst-port=1902 in-bridge=bridge-mdns \
ip-protocol=udp mac-protocol=ip out-bridge=bridge-mdns
add action=drop chain=forward comment="Drop all other L2 traffic" in-bridge=bridge-mdns out-bridge=bridge-mdns
/interface bridge nat
add action=src-nat chain=srcnat comment="mDNS - SNAT to Primary VLAN bridge" dst-mac-address=01:00:5E:00:00:FB/FF:FF:FF:FF:FF:FF to-src-mac-address=F4:1E:57:3D:AA:E5
add action=src-nat chain=srcnat comment="SSDP - SNAT to Primary VLAN bridge" dst-mac-address=01:00:5E:7F:FF:FA/FF:FF:FF:FF:FF:FF to-src-mac-address=F4:1E:57:3D:AA:E5
/interface bridge port
add bridge=bridge interface=sfp4-server-trunk
add bridge=bridge interface=lag-trunk
add bridge=bridge interface=ether12
add bridge=bridge interface=ether10 pvid=10
add bridge=bridge interface=ether9 pvid=9
add bridge=bridge interface=ether8 pvid=5
add bridge=bridge interface=ether6 pvid=6
add bridge=bridge interface=ether5 pvid=5
add bridge=bridge-mdns interface=macvlan5-iot
add bridge=bridge-mdns interface=macvlan6-cameras
add bridge=bridge-mdns interface=macvlan9-iotonline
add bridge=bridge-mdns interface=macvlan10-lan
/ip neighbor discovery-settings
set discover-interface-list=ManagementAllowed
/ipv6 settings
set disable-ipv6=yes
/interface bridge vlan
add bridge=bridge tagged=lag-trunk,bridge,sfp4-server-trunk untagged=ether10 vlan-ids=10
add bridge=bridge tagged=bridge,lag-trunk,sfp4-server-trunk untagged=ether5 vlan-ids=5
add bridge=bridge tagged=bridge,lag-trunk,sfp4-server-trunk untagged=ether6 vlan-ids=6
add bridge=bridge tagged=bridge,lag-trunk,sfp4-server-trunk untagged=ether12 vlan-ids=1
add bridge=bridge tagged=bridge,lag-trunk,sfp4-server-trunk untagged=ether9 vlan-ids=9
add bridge=bridge tagged=bridge,lag-trunk,sfp4-server-trunk vlan-ids=15
/interface ethernet switch
set 0 l3-hw-offloading=yes name=switch
/interface list member
add interface=bridge list=LAN
add interface=vlan10-lan list=ManagementAllowed
add interface=vlan1-management list=ManagementAllowed
add interface=ether13-localmanagement list=ManagementAllowed
add interface=ether3-wan-backup list=WAN
add interface=sfp1-xgspon list=WAN
/interface ovpn-server servers
add mac-address=FE:CB:7E:18:7D:DE name=ovpn-server1
/ip address
add address=192.168.5.1/24 interface=vlan1-management network=192.168.5.0
add address=192.168.8.1/24 interface=vlan5-iot network=192.168.8.0
add address=192.168.9.1/24 interface=vlan9-iotonline network=192.168.9.0
add address=192.168.10.1/24 interface=vlan10-lan network=192.168.10.0
add address=192.168.15.1/24 interface=vlan15-wifiguests network=192.168.15.0
add address=192.168.6.1/24 interface=vlan6-cameras network=192.168.6.0
/ip cloud
set update-time=no
/ip dhcp-client
add default-route-distance=2 interface=ether3-wan-backup use-peer-dns=no use-peer-ntp=no
# Interface not active
add interface=sfp1-xgspon use-peer-dns=no use-peer-ntp=no
/ip dhcp-server network
add address=192.168.5.0/24 dhcp-option="Unifi adopt" dns-server=192.168.5.1 gateway=192.168.5.1
add address=192.168.6.0/24 dns-server=192.168.6.1 gateway=192.168.6.1
add address=192.168.8.0/24 dns-server=192.168.8.1 gateway=192.168.8.1
add address=192.168.9.0/24 dns-server=192.168.9.1 gateway=192.168.9.1
add address=192.168.10.0/24 dns-server=192.168.10.210 gateway=192.168.10.1
add address=192.168.15.0/24 dns-server=192.168.15.1 gateway=192.168.15.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,1.0.0.1
/ip firewall address-list
add address=192.168.9.160 list=sonos
add address=192.168.9.161 list=sonos
add address=192.168.9.162 list=sonos
add address=192.168.9.163 list=sonos
add address=192.168.9.164 list=sonos
add address=192.168.9.165 list=sonos
add address=192.168.8.145 list=tuya
add address=192.168.8.146 list=tuya
/ip firewall filter
add action=fasttrack-connection chain=forward comment="fast-track for established,related" connection-state=established,related hw-offload=yes
add action=accept chain=forward comment="accept established,related,untracked" connection-state=established,related,untracked
add action=accept chain=input comment="accept established,related,untracked" connection-state=established,related,untracked
add action=drop chain=input comment="drop invalid" connection-state=invalid
add action=drop chain=input comment="drop blacklisted IPs" connection-state=new in-interface-list=WAN src-address-list=pwlgrzs-blacklist
add action=accept chain=input comment="accept ICMP" protocol=icmp
add action=accept chain=forward comment="Allow forwarded HTTPS port 443" connection-nat-state=dstnat dst-port=443 in-interface-list=WAN protocol=tcp
add action=accept chain=forward comment="Allow forwarded HTTP port 80" connection-nat-state=dstnat dst-port=80 in-interface-list=WAN protocol=tcp
add action=drop chain=input comment="drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
add action=accept chain=input comment="allow Winbox" in-interface-list=ManagementAllowed port=8291 protocol=tcp
add action=accept chain=input comment="allow SSH" in-interface-list=ManagementAllowed port=22 protocol=tcp
add action=accept chain=input comment="allow mikrotik api" in-interface-list=ManagementAllowed port=8728 protocol=tcp
add action=accept chain=input comment="allow mikrotik api" in-interface-list=ManagementAllowed port=8729 protocol=tcp
add action=accept chain=input comment="allow ftp" in-interface-list=ManagementAllowed port=21 protocol=tcp
add action=accept chain=input comment="allow telnet" in-interface-list=ManagementAllowed port=23 protocol=tcp
add action=accept chain=input comment="allow web admin" in-interface-list=ManagementAllowed port=80 protocol=tcp
add action=accept chain=forward comment="Allow TCP for Sonos 3400" dst-address=192.168.10.0/24 dst-port=3400-3401 protocol=tcp src-address-list=sonos
add action=accept chain=forward comment="Allow TCP for Sonos 445" dst-address=192.168.10.0/24 dst-port=445 protocol=tcp src-address-list=sonos
add action=accept chain=forward comment="Allow TCP for Sonos 3500" dst-address=192.168.10.0/24 dst-port=3500 protocol=tcp src-address-list=sonos
add action=accept chain=forward comment="Allow UDP for Sonos 319" dst-address=192.168.10.0/24 dst-port=319-320 protocol=udp src-address-list=sonos
add action=accept chain=forward comment="Allow UDP for Sonos 6969" dst-address=192.168.10.0/24 dst-port=6969 protocol=udp src-address-list=sonos
add action=accept chain=forward comment="Allow UDP for Sonos 49152-65535" dst-address=192.168.10.0/24 dst-port=49152-65535 protocol=udp src-address-list=sonos
add action=accept chain=forward comment="Allow 192.168.5.180 to 192.168.10.210 on TCP port 3493 for UPS" dst-address=192.168.10.210 dst-port=3493 protocol=tcp src-address=192.168.5.180
add action=accept chain=forward comment="Allow 192.168.5.180 to 192.168.10.199 on all protocols and ports" dst-address=192.168.10.199 src-address=192.168.5.180
add action=accept chain=forward comment="Allow all traffic from vlan10-lan to other VLANs" src-address=192.168.10.0/24
add action=accept chain=forward comment="Allow internet access for vlan10-lan" out-interface-list=WAN src-address=192.168.10.0/24
add action=accept chain=forward comment="Allow internet access for vlan9-iotonline" out-interface-list=WAN src-address=192.168.9.0/24
add action=accept chain=forward comment="Allow access to NTP on the internet from vlan5-iot" dst-port=123 protocol=udp src-address=192.168.8.0/24
add action=drop chain=forward comment="Block traffic from other VLANs to vlan10-lan" dst-address=192.168.10.0/24
add action=drop chain=forward comment="Block traffic from vlan1-management to other VLANs" src-address=192.168.5.0/24
add action=drop chain=forward comment="Block internet access for all other VLANs" out-interface-list=WAN
add action=drop chain=forward comment="Deny Internet access from Tuya list" out-interface-list=WAN src-address-list=tuya
add action=drop chain=forward comment="Block TCP DNS from vlan5-iot" dst-port=53 protocol=tcp src-address=192.168.8.0/24
add action=drop chain=forward comment="Block UDP DNS from vlan5-iot" dst-port=53 protocol=udp src-address=192.168.8.0/24
add action=drop chain=forward comment="Deny DNS from Tuya list" dst-port=53 protocol=tcp src-address-list=tuya
add action=drop chain=forward comment="Deny DNS from Tuya list" dst-port=53 protocol=udp src-address-list=tuya
add action=accept chain=forward comment="Allow TCP DNS from vlan10-lan" dst-port=53 protocol=tcp src-address=192.168.10.0/24
add action=accept chain=forward comment="Allow UDP DNS from vlan10-lan" dst-port=53 protocol=udp src-address=192.168.10.0/24
add action=accept chain=forward comment="Allow TCP DNS from vlan9-iotonline" dst-port=53 protocol=tcp src-address=192.168.9.0/24
add action=accept chain=forward comment="Allow UDP DNS from vlan9-iotonline" dst-port=53 protocol=udp src-address=192.168.9.0/24
add action=accept chain=forward comment="Allow TCP DNS from vlan15-wifiguests" dst-port=53 protocol=tcp src-address=192.168.15.0/24
add action=accept chain=forward comment="Allow UDP DNS from vlan15-wifiguests" dst-port=53 protocol=udp src-address=192.168.15.0/24
add action=drop chain=forward comment="Block traffic from vlan5-iot to other VLANs" src-address=192.168.8.0/24
add action=drop chain=forward comment="Block traffic from vlan6-cameras to other VLANs" src-address=192.168.6.0/24
add action=drop chain=forward comment="Block traffic from vlan9-iotonline to other VLANs" src-address=192.168.9.0/24
add action=drop chain=forward comment="Block traffic from vlan15-wifiguests to other VLANs" src-address=192.168.15.0/24
add action=drop chain=forward comment="drop access to clients behind NAT from WAN" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="Internet access" out-interface-list=WAN
add action=dst-nat chain=dstnat comment="Forward port 80" dst-port=80 in-interface-list=WAN protocol=tcp to-addresses=192.168.10.210
add action=dst-nat chain=dstnat comment="Forward port 443" dst-port=443 in-interface-list=WAN protocol=tcp to-addresses=192.168.10.210
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip ipsec mode-config
add address-pool=pool-ipsec-dhcp address-prefix-length=32 name=vpn-ipsec-ikev2
/ip ipsec profile
set [ find default=yes ] dpd-interval=2m dpd-maximum-failures=5
/ip service
set telnet address=192.168.10.0/24,192.168.5.0/24
set ftp address=192.168.10.0/24,192.168.5.0/24
set www address=192.168.10.0/24,192.168.5.0/24
set ssh address=192.168.10.0/24,192.168.5.0/24
set www-ssl address=192.168.10.0/24,192.168.5.0/24
set api address=192.168.10.0/24,192.168.5.0/24
set winbox address=192.168.10.0/24,192.168.5.0/24
set api-ssl address=192.168.10.0/24,192.168.5.0/24
/ip smb shares
set [ find default=yes ] directory=pub
/ip ssh
set strong-crypto=yes
/system clock
set time-zone-name=Europe/Brussels
/system health settings
set fan-min-speed-percent=10%
/system note
set show-at-login=no
/system ntp client
set enabled=yes
/system ntp client servers
add address=europe.pool.ntp.org
/system package update
set channel=testing
/system routerboard reset-button
set enabled=yes
/system routerboard settings
set enter-setup-on=delete-key
/system scheduler
add interval=1w name=dl-mt-blacklist on-event=pwlgrzs-blacklist-dl policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=2000-01-01 start-time=00:05:00
add interval=1w name=ins-mt-blacklist on-event=pwlgrzs-blacklist-replace policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=2000-01-01 start-time=00:10:00
/system script
add dont-require-permissions=no name=pwlgrzs-blacklist-dl owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
"/tool fetch url=\"https://raw.githubusercontent.com/pwlgrzs/Mikrotik-Blacklist/master/blacklist.rsc\" mode=https"
add dont-require-permissions=no name=pwlgrzs-blacklist-replace owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=\
"/ip firewall address-list remove [find where list=\"pwlgrzs-blacklist\"]; /import file-name=blacklist.rsc; /file remove blacklist.rsc"
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=ManagementAllowed
/tool mac-server mac-winbox
set allowed-interface-list=ManagementAllowed
edit: Updated config - pulled config when device had WAN connection
edit2: Added attempt to update to 7.17beta2