@Czeczenski
Let’s build a clean, fully segmented, VLAN‑based architecture you can actually paste and adapt.
I’ll give you:
A clear design
A RouterOS v7 config skeleton (CCR2116‑12G‑4S+)
Clean firewall model that won’t silently kill your traffic
- Target design
Physical:
WAN: sfp-sfpplus1 → ISP (DHCP)
LAN bridge: bridge_lan with VLAN filtering
Access ports:
ether1 → MGMT (untagged VLAN 10)
ether2 → Users (untagged VLAN 20)
ether3 → Servers (untagged VLAN 30)
ether4 → Guest (untagged VLAN 40)
Trunk ports:
sfp-sfpplus2 → downstream switch (tagged VLANs 10/20/30/40)
- Logical VLANs:
VLAN 10 – MGMT: 10.10.10.0/24, gateway 10.10.10.1
VLAN 20 – USERS: 10.10.20.0/24, gateway 10.10.20.1
VLAN 30 – SERVERS: 10.10.30.0/24, gateway 10.10.30.1
VLAN 40 – GUEST: 10.10.40.0/24, gateway 10.10.40.1
-
Base interfaces and bridge with VLAN filtering
/interface ethernet
set [ find default-name=sfp-sfpplus1 ] name=sfp-sfpplus1_wan
set [ find default-name=sfp-sfpplus2 ] name=sfp-sfpplus2_trunk
/interface bridge
add name=bridge_lan vlan-filtering=yes
/interface bridge port
add bridge=bridge_lan interface=ether1 pvid=10
add bridge=bridge_lan interface=ether2 pvid=20
add bridge=bridge_lan interface=ether3 pvid=30
add bridge=bridge_lan interface=ether4 pvid=40
add bridge=bridge_lan interface=sfp-sfpplus2_trunk
/interface vlan
add name=vlan10_mgmt interface=bridge_lan vlan-id=10
add name=vlan20_users interface=bridge_lan vlan-id=20
add name=vlan30_srv interface=bridge_lan vlan-id=30
add name=vlan40_guest interface=bridge_lan vlan-id=40
-
VLAN table on the bridge
/interface bridge vlan
VLAN 10 – MGMT
add bridge=bridge_lan vlan-ids=10 tagged=bridge_lan,sfp-sfpplus2_trunk untagged=ether1
VLAN 20 – USERS
add bridge=bridge_lan vlan-ids=20 tagged=bridge_lan,sfp-sfpplus2_trunk untagged=ether2
VLAN 30 – SERVERS
add bridge=bridge_lan vlan-ids=30 tagged=bridge_lan,sfp-sfpplus2_trunk untagged=ether3
VLAN 40 – GUEST
add bridge=bridge_lan vlan-ids=40 tagged=bridge_lan,sfp-sfpplus2_trunk untagged=ether4
- IP addressing and DHCP
/ip address
add address=10.10.10.1/24 interface=vlan10_mgmt comment="MGMT"
add address=10.10.20.1/24 interface=vlan20_users comment="USERS"
add address=10.10.30.1/24 interface=vlan30_srv comment="SERVERS"
add address=10.10.40.1/24 interface=vlan40_guest comment="GUEST"
/ip pool
add name=pool_mgmt ranges=10.10.10.100-10.10.10.199
add name=pool_users ranges=10.10.20.100-10.10.20.199
add name=pool_srv ranges=10.10.30.100-10.10.30.199
add name=pool_guest ranges=10.10.40.100-10.10.40.199
/ip dhcp-server
add name=dhcp_mgmt interface=vlan10_mgmt address-pool=pool_mgmt
add name=dhcp_users interface=vlan20_users address-pool=pool_users
add name=dhcp_srv interface=vlan30_srv address-pool=pool_srv
add name=dhcp_guest interface=vlan40_guest address-pool=pool_guest
/ip dhcp-server network
add address=10.10.10.0/24 gateway=10.10.10.1 dns-server=10.10.10.1
add address=10.10.20.0/24 gateway=10.10.20.1 dns-server=10.10.20.1
add address=10.10.30.0/24 gateway=10.10.30.1 dns-server=10.10.30.1
add address=10.10.40.0/24 gateway=10.10.40.1 dns-server=10.10.40.1
/ip dns
set servers=8.8.8.8,1.1.1.1 allow-remote-requests=yes
-
WAN via DHCP and routing
/interface list
add name=WAN
add name=LAN
add name=MGMT
/interface list member
add interface=sfp-sfpplus1_wan list=WAN
add interface=vlan10_mgmt list=MGMT
add interface=vlan10_mgmt list=LAN
add interface=vlan20_users list=LAN
add interface=vlan30_srv list=LAN
add interface=vlan40_guest list=LAN
/ip dhcp-client
add interface=sfp-sfpplus1_wan use-peer-dns=no use-peer-ntp=yes add-default-route=yes
-
Firewall and NAT (clean, predictable)
/ip firewall nat
add chain=srcnat action=masquerade out-interface-list=WAN comment="NAT: LAN->WAN"
/ip firewall filter
1. INPUT chain – protect router itself
add chain=input action=accept connection-state=established,related comment="INPUT: established,related"
add chain=input action=drop connection-state=invalid comment="INPUT: drop invalid"
Allow ICMP to router
add chain=input action=accept protocol=icmp comment="INPUT: allow ICMP"
Allow DHCP from ISP
add chain=input action=accept in-interface-list=WAN protocol=udp dst-port=67,68 comment="INPUT: DHCP from ISP"
Allow MGMT subnet to manage router
add chain=input action=accept in-interface=vlan10_mgmt comment="INPUT: MGMT access"
Drop everything else to router
add chain=input action=drop comment="INPUT: drop all else"
2. FORWARD chain – traffic through router
add chain=forward action=accept connection-state=established,related comment="FWD: established,related"
add chain=forward action=drop connection-state=invalid comment="FWD: drop invalid"
Allow LAN -> WAN
add chain=forward action=accept in-interface-list=LAN out-interface-list=WAN comment="FWD: LAN to WAN"
Inter‑VLAN policy (examples)
MGMT can reach everything
add chain=forward action=accept src-address=10.10.10.0/24 comment="FWD: MGMT to all"
USERS can reach SERVERS, but not MGMT
add chain=forward action=accept src-address=10.10.20.0/24 dst-address=10.10.30.0/24 comment="FWD: USERS to SERVERS"
add chain=forward action=drop src-address=10.10.20.0/24 dst-address=10.10.10.0/24 comment="FWD: block USERS to MGMT"
GUEST: internet only, no internal
add chain=forward action=drop src-address=10.10.40.0/24 dst-address=10.10.0.0/16 comment="FWD: block GUEST to internal"
Default: drop everything not explicitly allowed
add chain=forward action=drop comment="FWD: drop all else"
- Management access (Winbox/SSH)
/tool mac-server mac-winbox
set allowed-interface-list=MGMT
/ip service
set winbox address=10.10.10.0/24
set ssh address=10.10.10.0/24