Desired setup in short:
- WAN dynamic from ISP
- LAN 172.31.1.0/24
- DHCP role on router (172.31.1.50-99)
- DNS server 172.31.1.1 (precondition, because I have domain network and to properly resolve domain services this DNS must be used)
- VLANs: ISP provided PBX connected to the routers switch port 10 (VLAN 20) and default PC network (VLAN10) as untagged egress (hybrid ports)
- I want router to be accessible from "PC VLAN", meaning, no special administrative VLAN access or something, because I don't have that understaning yet.
Thank you!
ROUTER SETUP:
Code: Select all
############################################################################
#
# ROUTER IDENTITIY, TIME ETC.
#
############################################################################
/system identity set name="HQ"
/system clock set time-zone-name=Europe/Ljubljana
############################################################################
#
# BRIDGE SETUP
#
# - create bridge to switch between desired interfaces
# - disable bridge vlan functionality during configuration
#
# Understanding:
# Bridge is a special kind of interface with functionality to bring together
# various physical/logical ports/interfaces/lists/tunnels as if they are
# attached to the same network. Because bridging can introduce network loops,
# bridge implements various loop preventions mechanisms (STP, RSTP, MSTP).
# Bridge functionality is CPU intensive. Multiple bridges allowed.
# Alternative to bridge(ing) is routing.
#
############################################################################
/interface bridge add name=BR1 protocol-mode=rstp vlan-filtering=no comment="Bridge"
############################################################################
#
# BRIDGE PORT SETUP
# - add interfaces/lists/ports/tunnels to the bridge
#
# - set ingress behaviour on each port (bridge itself can also do this, but we want to be port specific here)
# - untagged ingress traffic is tagged with PVID (if not set defaults to 1)
# - tagged ingress traffic is left as is
# - actual tagging/untagging takes place on egress (when leaving bridge)
#
# Example below:
# - ingress on ether2 will pass on all declared VLANs (uplink trunk)
# - which VLANs are allowed is defined by bridge vlan filtering (10 and 20 in our case)
# - ingress on ether3-9 (hybrid ports for VoIP phone => PC connection)
# - will be tagged 10 if untagged (PC ingress)
# - already tagged 20 will be passed on (VOIP PHONE)
# - all other (tagged) traffic is dropped
# - ingress on ether10 will be tagged 20 if untagged (VOIP PBX)
#
# Question:
# Would use of interface lists be appropriate here?
# Like grouping ether3-9 under list HYBRID_PORTS?
#
# Bridge VLAN switching in RB4011 doesn't support HW offloading.
# What would be equivalent built-in switch chip VLAN setup?
# Seems like RB4011 switch chip doesn't support hybrid ports? ...so no switch chip alternative?
#
############################################################################
/interface bridge port
add bridge=BR1 interface=ether2 hw=yes comment="Trunk for VLAN 10 and 20,... uplink"
add bridge=BR1 interface=ether3 hw=yes pvid=10 comment="Hybrid: untagged => 10"
add bridge=BR1 interface=ether4 hw=yes pvid=10 comment="Hybrid: untagged => 10"
add bridge=BR1 interface=ether5 hw=yes pvid=10 comment="Hybrid: untagged => 10"
add bridge=BR1 interface=ether6 hw=yes pvid=10 comment="Hybrid: untagged => 10"
add bridge=BR1 interface=ether7 hw=yes pvid=10 comment="Hybrid: untagged => 10"
add bridge=BR1 interface=ether8 hw=yes pvid=10 comment="Hybrid: untagged => 10"
add bridge=BR1 interface=ether9 hw=yes pvid=10 comment="Hybrid: untagged => 10"
add bridge=BR1 interface=ether10 hw=yes pvid=20 comment="VoIP PBX: untagged => 20"
############################################################################
#
# BRIDGE VLAN FILTERING
#
# - egress behaviour
#
# - create bridge vlan filters to manage VLAN switching
# - untag/tag egress port traffic according to vlan ids
#
# Example below:
# - egress on ether3-9 will be untagged if tagged 10 (PC)
# - egress tagged V20 will be allowed (Hybrid: PC + VOIP PHONE)
# - egress on ether10 will be untagged if tagged 20 (VOIP PBX)
# - question: is all other tagged traffic dropped?
# - egress on ether2 will be allowed if tagged 10 or 20 (uplink trunk)
#
############################################################################
/interface bridge vlan
add bridge=BR1 vlan-ids=10 untagged=ether3,ether4,ether5,ether6,ether7,ether8,ether9 tagged=ether2 comment="PC"
add bridge=BR1 vlan-ids=20 untagged=ether10 tagged=ether2,ether3,ether4,ether5,ether6,ether7,ether8 comment="VOIP"
############################################################################
#
# VLANs
#
# - create VLANs and add them to the bridge (for VLAN filtering)
# - add address pools and dhcp as required for each VLAN
#
# Example below:
# - ip address pool for PCs is created (range 172.31.1.50-99)
# - vlan 10 for normal pc network is created
# - dhcp for assigning IPs to vlan 10 is created
#
# Question:
# I lack understanding how this VLAN setup is related to the bridge vlan setup.
# We already setup bridge vlan filtering, and don't understand what
# I actualy do here by creating VLAN interface and asigning it to the bridge (BR1).
#
############################################################################
/ip pool add name=PC_POOL ranges=172.31.1.50-172.31.1.99
/interface vlan add interface=BR1 name=PC_VLAN vlan-id=10
/ip dhcp-server add address-pool=PC_POOL interface=PC_VLAN name=PC_DHCP
/ip dhcp-server network add address=172.31.1.0/24 dns-server=172.31.1.1 gateway=172.31.1.254
# IP phones (VLAN 20) have configured static IP/GW configured (current PBX setup)
/interface vlan add interface=BR1 name=VOIP_VLAN vlan-id=20
############################################################################
#
# WAN - internet connection setup
#
############################################################################
# WAN facing port with dynamic IP Address provided by ISP
/ip dhcp-client add interface=ether1
############################################################################
#
# LAN facing router's IP address
# My default PC network is now actualy VLAN 10 so I need to add router's IP
# on the VLAN 10?
#
############################################################################
/ip address add address=172.31.1.254/24 interface=PC_VLAN
############################################################################
#
# DNS
# We currently have windows domain set up therefore to properly resolve
# domain services AD/DNS must be used.
#
# Question:
# DNS service doesn't require any VLAN configuration?
#
############################################################################
# DNS server (windows domain server), set to cache for LAN
/ip dns set allow-remote-requests=yes servers="172.31.1.1"
############################################################################
#
# INTERFACE LISTS
#
# I don't understand this part clearly.
# What can I do with these lists now or why do I need them?
#
############################################################################
# Use MikroTik's "list" feature for easy rule matchmaking.
/interface list add name=WAN
/interface list add name=LAN
/interface list member
add interface=ether1 list=WAN
add interface=PC_VLAN list=LAN
add interface=VOIP_VLAN list=LAN