/interface bridge
add name=bridge1 vlan-filtering=yes
/interface ethernet
set [ find default-name=ether1 ] name=Port1-AP
set [ find default-name=ether2 ] name=Port2-WAN
set [ find default-name=ether3 ] name=Port3-Server1
set [ find default-name=ether4 ] name=Port4-Server2
set [ find default-name=ether5 ] name=Port5-Wohnzimmer
set [ find default-name=ether6 ] name=Port6-Arbeitszimmer
set [ find default-name=ether7 ] name=Port7-PCZimmer
set [ find default-name=ether8 ] name=Port8-Dachzimmer
set [ find default-name=sfp-sfpplus1 ] name=SFP-Uplink
/interface vlan
add interface=bridge1 name=Int-VLAN10-Mgmt vlan-id=10
add interface=bridge1 name=Int-VLAN20-Home vlan-id=20
add interface=bridge1 name=Int-VLAN30-Work vlan-id=30
add interface=bridge1 name=Int-VLAN40-IoT vlan-id=40
add interface=bridge1 name=Int-VLAN50-Media vlan-id=50
/interface list
add name=LAN
add name=WAN
/ip pool
add name=dhcp_pool0 ranges=192.168.10.20-192.168.10.100
add name=dhcp_pool1 ranges=192.168.30.20-192.168.30.200
/ip dhcp-server
add address-pool=dhcp_pool0 interface=Int-VLAN10-Mgmt lease-time=1d name=dhcp1
add address-pool=dhcp_pool1 interface=Int-VLAN30-Work lease-time=1d name=dhcp2
/interface bridge port
add bridge=bridge1 interface=Port8-Dachzimmer pvid=10
add bridge=bridge1 interface=Port1-AP
add bridge=bridge1 interface=Port3-Server1
add bridge=bridge1 interface=Port4-Server2
add bridge=bridge1 interface=Port5-Wohnzimmer
add bridge=bridge1 interface=Port6-Arbeitszimmer pvid=30
add bridge=bridge1 interface=Port7-PCZimmer
add bridge=bridge1 interface=SFP-Uplink
/interface bridge settings
set allow-fast-path=no use-ip-firewall=yes use-ip-firewall-for-pppoe=yes use-ip-firewall-for-vlan=yes
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface bridge vlan
add bridge=bridge1 comment=Arbeit tagged=SFP-Uplink,bridge1 untagged=Port6-Arbeitszimmer vlan-ids=30
add bridge=bridge1 comment=Management tagged=bridge1,SFP-Uplink untagged=Port8-Dachzimmer vlan-ids=10
add bridge=bridge1 comment=Home tagged=SFP-Uplink,Port1-AP,Port5-Wohnzimmer,bridge1 vlan-ids=20
add bridge=bridge1 comment=Native tagged=bridge1 untagged=SFP-Uplink vlan-ids=1
add bridge=bridge1 comment="Internet of Shit" tagged=Port1-AP,bridge1 vlan-ids=40
add bridge=bridge1 comment=Media tagged=bridge1,Port1-AP,SFP-Uplink,Port5-Wohnzimmer,Port7-PCZimmer \
vlan-ids=50
/interface detect-internet
set detect-interface-list=WAN
/interface list member
add interface=bridge1 list=LAN
add interface=Port8-Dachzimmer list=LAN
add interface=Int-VLAN10-Mgmt list=LAN
add interface=Int-VLAN30-Work list=LAN
add interface=Port6-Arbeitszimmer list=LAN
add interface=Port2-WAN list=WAN
add interface=SFP-Uplink list=LAN
/ip address
add address=192.168.10.1/24 interface=Int-VLAN10-Mgmt network=192.168.10.0
add address=192.168.30.1/24 interface=Int-VLAN30-Work network=192.168.30.0
add address=192.168.20.1/24 interface=Int-VLAN20-Home network=192.168.20.0
add address=192.168.40.1/24 interface=Int-VLAN40-IoT network=192.168.40.0
add address=192.168.50.1/24 interface=Int-VLAN50-Media network=192.168.50.0
/ip dhcp-client
add interface=Port2-WAN
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=192.168.178.10 gateway=192.168.10.1
add address=192.168.30.0/24 dns-server=192.168.178.10 gateway=192.168.30.1
/ip firewall filter
add action=accept chain=forward comment="Internetzugang von VLAN10" in-interface=Int-VLAN10-Mgmt \
out-interface=Port2-WAN
add action=accept chain=forward comment="Internetzugang von VLAN20" in-interface=Int-VLAN20-Home \
out-interface=Port2-WAN
add action=accept chain=forward comment="Internetzugang von VLAN30" in-interface=Int-VLAN30-Work \
out-interface=Port2-WAN
add action=accept chain=forward comment="accept established,related" connection-state=established,related
add action=accept chain=input comment="Ping erlauben im ganzen Netz" protocol=icmp
add action=accept chain=forward protocol=icmp
add action=accept chain=input comment=Managementzugang in-interface=Int-VLAN10-Mgmt
add action=drop chain=forward comment="drop access to clients behind NAT from WAN" connection-nat-state=\
!dstnat connection-state=new in-interface=bridge1
add action=drop chain=forward connection-state=invalid
add action=drop chain=input comment="Deny any any"
add action=drop chain=forward
/ip firewall nat
add action=masquerade chain=srcnat out-interface=Port2-WAN
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www address=192.168.10.0/24
set ssh port=2200
set www-ssl address=192.168.10.0/24 disabled=no
set api disabled=yes
set winbox address=192.168.10.0/24
/system clock
set time-zone-name=Europe/Berlin
/system identity
set name=MT-RB5009UPr
/system note
set show-at-login=no
/system ntp client
set enabled=yes
/system ntp server
set enabled=yes
/system ntp client servers
add address=ptbtime1.ptb.de
add address=de.pool.ntp.org
add address="ntp.metas.ch "
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN