Hello guys,
I hope y’all are well and that this is not against any rule. If so I’ll remove this post.
I am completely new to MikroTik (~2 weeks old) with (very) limited networking experience.
I bought a MikroTik hAP ax2 to have a better ownership of my home network, and support a company providing the kind of hardware/software support MikroTik does.
I wanted to:
- Enable VLAN filtering, having 4 VLANs (for main, homelab, IoT, guests)
- Have 4 access points, one per VLAN
- Have custom firewall rules across VLANs
I know (think?) my setup is pretty standard, but I couldn’t find anyone doing it as I do. I went through the forum, countless youtube videos, other people’s configurations and the documentation (e.g. Using RouterOS to VLAN your network ). I managed (after getting locked out way to many times) to setup my config as I wanted to, and it seems to work as I intend it to.
However, I know that I cannot judge whether I accidentally made a dumb mistake and let my router with an open hole allowing external access, especially since I tweaked the firewall rules.
I am running RouterOS 7.21 (stable).
Below is my config
# 2026-01-30 12:47:33 by RouterOS 7.21
# software id = 5QYW-B1W7
#
# model = C52iG-5HaxD2HaxD
# serial number = mod removed
/interface bridge
add admin-mac=04:F4:1C:9A:A6:87 auto-mac=no comment=defconf name=bridge \
vlan-filtering=yes
/interface vlan
add interface=bridge name=vlan10-main vlan-id=10
add interface=bridge name=vlan20-homelab vlan-id=20
add interface=bridge name=vlan30-iot vlan-id=30
add interface=bridge name=vlan40-guest vlan-id=40
/interface list
add comment=defconf name=WAN
add comment="all VLANs" name=VLAN
add include=VLAN name=LAN
/interface wifi configuration
add name=cfg-main security.authentication-types=wpa2-psk,wpa3-psk .wps=\
disable ssid=ansuz-main
add name=cfg-iot security.authentication-types=wpa2-psk,wpa3-psk .wps=disable \
ssid=ansuz-iot
add name=cfg-guest security.authentication-types=wpa2-psk,wpa3-psk .wps=\
disable ssid=ansuz-guest
add name=cfg-homelab security.authentication-types=wpa2-psk,wpa3-psk .wps=\
disable ssid=ansuz-homelab
/interface wifi
set [ find default-name=wifi1 ] channel.band=5ghz-ax .skip-dfs-channels=\
10min-cac .width=20/40/80mhz configuration=cfg-main configuration.mode=ap \
disabled=no security.authentication-types=wpa2-psk,wpa3-psk .ft=yes \
.ft-over-ds=yes
add configuration=cfg-guest disabled=no mac-address=06:F4:1C:9A:A6:8D \
master-interface=wifi1 name=wifi1-guest
add configuration=cfg-homelab disabled=no mac-address=06:F4:1C:9A:A6:8F \
master-interface=wifi1 name=wifi1-homelab
add configuration=cfg-iot disabled=no mac-address=06:F4:1C:9A:A6:8B \
master-interface=wifi1 name=wifi1-iot
set [ find default-name=wifi2 ] channel.band=2ghz-ax .skip-dfs-channels=\
10min-cac .width=20mhz configuration=cfg-main configuration.mode=ap \
disabled=no security.authentication-types=wpa2-psk,wpa3-psk .ft=yes \
.ft-over-ds=yes
add configuration=cfg-guest disabled=no mac-address=06:F4:1C:9A:A6:8E \
master-interface=wifi2 name=wifi2-guest
add configuration=cfg-homelab disabled=no mac-address=06:F4:1C:9A:A6:90 \
master-interface=wifi2 name=wifi2-homelab
add configuration=cfg-iot disabled=no mac-address=06:F4:1C:9A:A6:8C \
master-interface=wifi2 name=wifi2-iot
/ip pool
add name=pool-main ranges=192.168.10.10-192.168.10.254
add name=pool-iot ranges=192.168.30.10-192.168.30.254
add name=pool-guest ranges=192.168.40.10-192.168.40.254
add name=pool-homelab ranges=192.168.20.10-192.168.20.254
/ip dhcp-server
add address-pool=pool-main interface=vlan10-main name=dhcp-main
add address-pool=pool-iot interface=vlan30-iot name=dhcp-iot
add address-pool=pool-guest interface=vlan40-guest name=dhcp-guest
add address-pool=pool-homelab interface=vlan20-homelab name=dhcp-homelab
/disk settings
set auto-media-interface=bridge auto-media-sharing=yes auto-smb-sharing=yes
/interface bridge port
add bridge=bridge comment=defconf interface=ether2 pvid=10
add bridge=bridge comment=defconf interface=ether3 pvid=10
add bridge=bridge comment=defconf interface=ether4 pvid=10
add bridge=bridge comment=defconf interface=ether5 pvid=10
add bridge=bridge comment=defconf interface=wifi1 pvid=10
add bridge=bridge comment=defconf interface=wifi2 pvid=10
add bridge=bridge interface=wifi1-iot pvid=30
add bridge=bridge interface=wifi2-iot pvid=30
add bridge=bridge interface=wifi1-guest pvid=40
add bridge=bridge interface=wifi2-guest pvid=40
add bridge=bridge interface=wifi1-homelab pvid=20
add bridge=bridge interface=wifi2-homelab pvid=20
/ip neighbor discovery-settings
set discover-interface-list=none
/interface bridge vlan
add bridge=bridge tagged=bridge untagged=\
ether2,ether3,ether4,ether5,wifi1,wifi2 vlan-ids=10
add bridge=bridge tagged=bridge untagged=wifi1-iot,wifi2-iot vlan-ids=30
add bridge=bridge tagged=bridge untagged=wifi1-guest,wifi2-guest vlan-ids=40
add bridge=bridge tagged=bridge untagged=wifi1-homelab,wifi2-homelab \
vlan-ids=20
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=vlan10-main list=VLAN
add interface=vlan30-iot list=VLAN
add interface=vlan40-guest list=VLAN
add interface=vlan20-homelab list=VLAN
/ip address
add address=192.168.10.1/24 interface=vlan10-main network=192.168.10.0
add address=192.168.30.1/24 interface=vlan30-iot network=192.168.30.0
add address=192.168.40.1/24 interface=vlan40-guest network=192.168.40.0
add address=192.168.20.1/24 interface=vlan20-homelab network=192.168.20.0
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=192.168.10.1 gateway=192.168.10.1
add address=192.168.20.0/24 dns-server=192.168.20.1 gateway=192.168.20.1
add address=192.168.30.0/24 dns-server=192.168.30.1 gateway=192.168.30.1
add address=192.168.40.0/24 dns-server=192.168.40.1 gateway=192.168.40.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan type=A
/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="main to router: ACCEPT" in-interface=\
vlan10-main
add action=accept chain=input comment="VLAN to router (DHCP): ACCEPT" \
dst-port=67 in-interface-list=VLAN protocol=udp
add action=accept chain=input comment="VLAN to router (DNS via UDP): ACCEPT" \
dst-port=53 in-interface-list=VLAN protocol=udp
add action=accept chain=input comment="VLAN to router (DNS via TCP): ACCEPT" \
dst-port=53 in-interface-list=VLAN protocol=tcp
add action=drop chain=input comment="VLAN to router: DROP"
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=accept chain=forward comment="main to any: ACCEPT" in-interface=\
vlan10-main
add action=accept chain=forward comment="VLAN to WAN: ACCEPT" \
in-interface-list=VLAN out-interface-list=WAN
add action=drop chain=forward comment="VLAN to any: DROP" in-interface-list=\
VLAN
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
/ip ssh
set strong-crypto=yes
/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" \
dst-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=fasttrack-connection chain=forward comment="defconf: fasttrack6" \
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 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/Zurich
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=none
/tool mac-server ping
set enabled=no
Would anyone be kind enough to help an afraid noob ?
I am mainly concerned about having a huge hole in my firewall.
Thank you very much
