For context, this is a testing configuration for a school kinda setup.
Code: Select all
# 2025-01-04 12:05:19 by RouterOS 7.16.2
# software id =
#
/interface bridge
add name=bridge1 vlan-filtering=yes
/interface ethernet
set [ find default-name=ether1 ] disable-running-check=no
set [ find default-name=ether2 ] disable-running-check=no
set [ find default-name=ether3 ] disable-running-check=no
set [ find default-name=ether4 ] disable-running-check=no
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe-out1 \
use-peer-dns=yes user=test_ppp1
add add-default-route=yes default-route-distance=2 disabled=no interface=\
ether2 name=pppoe-out2 user=test_ppp2
add add-default-route=yes default-route-distance=3 disabled=no interface=\
ether1 name=pppoe-out3 user=test_ppp3
/interface wireguard
add listen-port=13231 mtu=1420 name=wireguard1
/interface vlan
add interface=bridge1 name=MGMT vlan-id=99
add interface=bridge1 name=Office vlan-id=20
add interface=bridge1 name=PublicPC vlan-id=30
add interface=bridge1 name=PublicWIFI vlan-id=60
add interface=bridge1 name=Server vlan-id=10
add interface=bridge1 name=StaffWIFI vlan-id=40
add interface=bridge1 name=StudentsWIFI vlan-id=50
/interface list
add name=LAN
add name=WAN
/ip pool
add name=dhcp_pool0 ranges=192.168.99.2-192.168.99.254
add name=dhcp_pool1 ranges=192.168.20.10-192.168.20.254
add name=dhcp_pool2 ranges=192.168.30.2-192.168.30.254
add name=dhcp_pool3 ranges=192.168.60.2-192.168.61.254
add name=dhcp_pool4 ranges=192.168.10.2-192.168.10.254
add name=dhcp_pool5 ranges=192.168.40.2-192.168.40.254
add name=dhcp_pool6 ranges=192.168.50.2-192.168.50.254
/routing table
add disabled=no fib name=cloud
add disabled=no fib name=to-wan1
add disabled=no fib name=to-wan2
add disabled=no fib name=to-wan3
/interface bridge port
add bridge=bridge1 interface=ether4
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add interface=ether1 list=WAN
add interface=ether2 list=WAN
add interface=ether3 list=WAN
add interface=MGMT list=LAN
add interface=Office list=LAN
add interface=PublicPC list=LAN
add interface=PublicWIFI list=LAN
add interface=Server list=LAN
add interface=StaffWIFI list=LAN
add interface=StudentsWIFI list=LAN
add interface=wireguard1 list=LAN
/interface wireguard peers
add allowed-address=192.168.32.2/32 interface=wireguard1 name=peer1 \
public-key="WBKN9fZA/5+zwSzSa21PN50QigvzHzmsFbtMqhnCsiY="
/ip address
add address=192.168.99.1/24 interface=MGMT network=192.168.99.0
add address=192.168.20.1/24 interface=Office network=192.168.20.0
add address=192.168.30.1/24 interface=PublicPC network=192.168.30.0
add address=192.168.60.1/23 interface=PublicWIFI network=192.168.60.0
add address=192.168.10.1/24 interface=Server network=192.168.10.0
add address=192.168.40.1/24 interface=StaffWIFI network=192.168.40.0
add address=192.168.50.1/24 interface=StudentsWIFI network=192.168.50.0
add address=192.168.32.1/24 interface=wireguard1 network=192.168.32.0
/ip dhcp-server
add address-pool=dhcp_pool0 interface=MGMT name=dhcp1
add address-pool=dhcp_pool1 interface=Office name=dhcp2
add address-pool=dhcp_pool2 interface=PublicPC name=dhcp3
add address-pool=dhcp_pool3 interface=PublicWIFI name=dhcp4
add address-pool=dhcp_pool4 interface=Server name=dhcp5
add address-pool=dhcp_pool5 interface=StaffWIFI name=dhcp6
add address-pool=dhcp_pool6 interface=StudentsWIFI name=dhcp7
/ip dhcp-server network
add address=192.168.10.0/24 gateway=192.168.10.1
add address=192.168.20.0/24 gateway=192.168.20.1
add address=192.168.30.0/24 gateway=192.168.30.1
add address=192.168.40.0/24 gateway=192.168.40.1
add address=192.168.50.0/24 gateway=192.168.50.1
add address=192.168.60.0/23 gateway=192.168.60.1
add address=192.168.99.0/24 gateway=192.168.99.1
/ip firewall address-list
add address=cloud.mikrotik.com list=mikrotik-cloud
add address=cloud2.mikrotik.com list=mikrotik-cloud
add address=dnnsname list=wan
/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 in-interface-list=LAN
add action=drop chain=input comment="Drop All" disabled=yes
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related hw-offload=yes
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="allow internet traffic" \
in-interface-list=LAN out-interface-list=WAN
add action=accept chain=forward comment="allow port forwarding" \
connection-nat-state=dstnat
add action=drop chain=forward
/ip firewall mangle
add action=mark-routing chain=output dst-address-list=mikrotik-cloud \
new-routing-mark=cloud passthrough=no
add action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface-list=LAN new-connection-mark=\
wan1_conn passthrough=yes per-connection-classifier=src-address:3/0
add action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface-list=LAN new-connection-mark=\
wan2_conn passthrough=yes per-connection-classifier=src-address:3/1
add action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface-list=LAN new-connection-mark=\
wan3_conn passthrough=yes per-connection-classifier=src-address:3/2
add action=mark-routing chain=prerouting connection-mark=wan1_conn \
new-routing-mark=to-wan1 passthrough=no
add action=mark-routing chain=prerouting connection-mark=wan2_conn \
new-routing-mark=to-wan2 passthrough=no
add action=mark-routing chain=prerouting connection-mark=wan3_conn \
new-routing-mark=to-wan3 passthrough=no
/ip firewall nat
add action=dst-nat chain=dstnat dst-port=8080 protocol=tcp src-address-list=\
wan to-addresses=192.168.10.2 to-ports=8080
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
add action=masquerade chain=srcnat out-interface=ether3
/ip ipsec profile
set [ find default=yes ] dpd-interval=2m dpd-maximum-failures=5
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-table=cloud \
suppress-hw-offload=no
add disabled=no distance=2 dst-address=0.0.0.0/0 gateway=pppoe-out2 \
routing-table=cloud scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=3 dst-address=0.0.0.0/0 gateway=pppoe-out3 \
routing-table=cloud scope=30 suppress-hw-offload=no target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
pppoe-out1 routing-table=to-wan1 scope=30 suppress-hw-offload=no \
target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
pppoe-out2 routing-table=to-wan2 scope=30 suppress-hw-offload=no \
target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
pppoe-out3 routing-table=to-wan3 scope=30 suppress-hw-offload=no \
target-scope=10
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh disabled=yes
set api disabled=yes
set api-ssl disabled=yes
/system note
set show-at-login=no
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/user settings
set minimum-categories=2 minimum-password-length=8