1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
| # sep/13/2021 14:47:52 by RouterOS 6.48.1
# software id = Z4VC-LFGX
#
# model = CRS125-24G-1S
# serial number = 49CC0404B29A
/interface bridge
add admin-mac=4C:5E:0C:9A:56:27 auto-mac=no comment=defconf name=bridge-LAN
/interface ethernet
set [ find default-name=ether1 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full" name=\
ether1-WAN
set [ find default-name=ether2 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether3 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether4 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full" name=\
ether4-APUnify
set [ find default-name=ether5 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether6 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether7 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether8 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether9 ] advertise="10M-half,10M-full,100M-half,100M-f\
ull,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether10 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether11 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether12 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether13 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether14 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full" name=\
ether14-trunk
set [ find default-name=ether15 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether16 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether17 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether18 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether19 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether20 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether21 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether22 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether23 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
set [ find default-name=ether24 ] advertise="10M-half,10M-full,100M-half,100M-\
full,1000M-half,1000M-full,2500M-full,5000M-full,10000M-full"
/interface vlan
add interface=ether4-APUnify name=vlan10-guest-eth4 vlan-id=10
add interface=ether14-trunk name=vlan10-guest-eth14 vlan-id=10
/interface bonding
add mode=802.3ad name=bonding-NAS slaves=ether21,ether22
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip kid-control
add disabled=yes name=kid1
add disabled=yes name=kid2
/ip pool
add name=dhcp-pool-lan ranges=192.168.1.30-192.168.1.254
add name=dhcp-pool-ovpn ranges=192.168.2.10-192.168.2.40
add name=dhcp_pool-guest ranges=192.168.3.10-192.168.3.254
/ip dhcp-server
add address-pool=dhcp-pool-lan disabled=no interface=bridge-LAN name=dhcp-LAN
add address-pool=dhcp_pool-guest disabled=no interface=vlan10-guest-eth4 \
name=dhcp-guest
/ppp profile
add local-address=192.168.2.1 name=vpn-profile remote-address=dhcp-pool-ovpn \
use-encryption=yes
/interface bridge port
add bridge=bridge-LAN comment=defconf disabled=yes interface=ether1-WAN
add bridge=bridge-LAN comment=defconf interface=ether2
add bridge=bridge-LAN comment=defconf interface=ether3
add bridge=bridge-LAN comment=defconf interface=ether4-APUnify
add bridge=bridge-LAN comment=defconf interface=ether5
add bridge=bridge-LAN comment=defconf interface=ether6
add bridge=bridge-LAN comment=defconf interface=ether7
add bridge=bridge-LAN comment=defconf interface=ether8
add bridge=bridge-LAN comment=defconf interface=ether9
add bridge=bridge-LAN comment=defconf interface=ether10
add bridge=bridge-LAN comment=defconf interface=ether11
add bridge=bridge-LAN comment=defconf interface=ether12
add bridge=bridge-LAN comment=defconf interface=ether13
add bridge=bridge-LAN comment=defconf interface=ether14-trunk
add bridge=bridge-LAN comment=defconf interface=ether15
add bridge=bridge-LAN comment=defconf interface=ether16
add bridge=bridge-LAN comment=defconf interface=ether17
add bridge=bridge-LAN comment=defconf interface=ether18
add bridge=bridge-LAN comment=defconf interface=ether19
add bridge=bridge-LAN comment=defconf interface=ether20
add bridge=bridge-LAN comment=defconf interface=ether23
add bridge=bridge-LAN comment=defconf interface=ether24
add bridge=bridge-LAN comment=defconf interface=sfp1
add bridge=bridge-LAN interface=bonding-NAS
/ip neighbor discovery-settings
set discover-interface-list=none
/interface list member
add interface=ether1-WAN list=WAN
add interface=bridge-LAN list=LAN
add interface=vlan10-guest-eth14 list=LAN
add interface=vlan10-guest-eth4 list=LAN
/interface ovpn-server server
set auth=sha1 certificate=server cipher=aes128,aes192,aes256 enabled=yes \
require-client-certificate=yes
/ip address
add address=192.168.1.1/24 comment=defconf interface=bridge-LAN network=\
192.168.1.0
add address=192.168.3.1/24 interface=vlan10-guest-eth4 network=192.168.3.0
/ip dhcp-client
add disabled=no interface=ether1-WAN
/ip dhcp-server lease
add address=192.168.1.10 client-id=1:b8:27:eb:43:1a:56 comment=\
"Raspberry pi" mac-address=B8:27:EB:43:1A:56 server=dhcp-LAN
add address=192.168.1.16 client-id=1:0:e:c6:c9:c8:10 comment="MiBox3" \
mac-address=00:0E:C6:C9:C8:10 server=dhcp-LAN
add address=192.168.1.6 client-id=1:0:11:32:db:a1:eb comment="NAS" \
mac-address=00:11:32:DB:A1:EB server=dhcp-LAN
add address=192.168.1.15 client-id=1:c8:db:26:1:24:52 comment=\
mac-address=C8:DB:26:01:24:52 server=dhcp-LAN
add address=192.168.1.5 client-id=1:0:11:32:3:89:4e comment=\
mac-address=00:11:32:03:89:4E server=dhcp-LAN
add address=192.168.1.3 client-id=1:74:83:c2:80:c1:db comment=\
"AP" mac-address=74:83:C2:80:C1:DB server=dhcp-LAN
add address=192.168.1.2 client-id=1:4c:5e:c:d6:ea:e9 comment=\
"RB" mac-address=4C:5E:0C:D6:EA:E9 server=dhcp-LAN
add address=192.168.1.7 client-id=1:a4:da:22:35:f9:b comment=\
mac-address=A4:DA:22:35:F9:0B server=dhcp-LAN
add address=192.168.1.11 client-id=\
ff:eb:48:5c:2f:0:1:0:1:23:f7:fb:7a:b8:27:eb:48:5c:2f comment=\
mac-address=B8:27:EB:48:5C:2F server=dhcp-LAN
add address=192.168.1.17 client-id=1:ac:67:84:e9:90:2e comment=\
mac-address=AC:67:84:E9:90:2E
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=192.168.1.1,8.8.8.8 domain=LAN.net \
gateway=192.168.1.1 netmask=24
add address=192.168.3.0/24 dns-server=8.8.8.8,8.8.4.4 domain=Guest.net \
gateway=192.168.3.1
/ip dns
set allow-remote-requests=yes servers=192.168.1.1
/ip dns static
add address=192.168.1.1 name=DNS-LAN
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=accept chain=input comment="allow OpenVPN" dst-port=1194 protocol=\
tcp
add action=reject chain=forward dst-address=8.8.8.8 reject-with=\
icmp-network-unreachable src-address=192.168.1.22
add action=reject chain=forward dst-address=8.8.4.4 reject-with=\
icmp-network-unreachable src-address=192.168.1.22
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=reject chain=forward comment="Block guest from LAN" dst-address=\
192.168.1.0/24 reject-with=icmp-network-unreachable src-address=\
192.168.3.0/24
add action=reject chain=forward comment="Block guest from OpenVPN network" \
dst-address=192.168.2.0/24 reject-with=icmp-network-unreachable \
src-address=192.168.3.0/24
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=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=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=WAN src-address=\
192.168.1.0/24
add action=masquerade chain=srcnat out-interface-list=WAN src-address=\
192.168.2.0/24
add action=masquerade chain=srcnat src-address=192.168.3.0/24
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set irc disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
set udplite disabled=yes
set dccp disabled=yes
set sctp disabled=yes
/ip kid-control device
add mac-address=50:50:A4:7A:6D:48 name="Tablet kid1" user=kid1
add mac-address=88:9F:6F:0A:55:54 name="Tablet kid2" user=kid2
/ip service
set telnet disabled=yes
set ftp address=192.168.1.0/24
set www address=192.168.1.0/24
set ssh disabled=yes
set api disabled=yes
set winbox address=192.168.1.0/24
set api-ssl disabled=yes
/lcd
set enabled=no
/lcd interface pages
set 1 interfaces=\
ether13,ether14-trunk,ether15,ether16,ether17,ether18,ether19
/ppp secret
add name=ovpn profile=vpn-profile service=ovpn
/system clock
set time-zone-name=Europe/Brussels
/system identity
set name=R1
/system ntp client
set enabled=yes
/system scheduler
add interval=1h name=DuckDNSUpdateScriptSchedule on-event=\
" /system script run DuckDNSUpdateScript" policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=may/01/2021 start-time=18:40:31
/system script
add dont-require-permissions=no name=DuckDNSUpdateScript owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="s\
cript\r\
\n:local resolvedIP [:resolve \"removed.duckdns.org\"];\r\
\n:local currentIP [/ip address get [find interface=\"ether1\"] address];\
\r\
\n:local currentIP [:pick \$currentIP 0 [:find \$currentIP \"/\"]];\r\
\n \r\
\n:if (\$resolvedIP != \$currentIP) do={\r\
\n :log info (\"Trying to update DuckDNS with actual IP \".\$currentIP.\
\", resolved IP is \".\$resolvedIP);\r\
\n :local response [/tool fetch url=(\"https://www.duckdns.org/update\?\
domains=removed&token=removed&ip=\".\$curren\
tIP) check-certificate=yes as-value output=user];\r\
\n :if (\$response->\"status\" = \"finished\") do={\r\
\n :if (\$response->\"data\" = \"OK\") do={\r\
\n :log info (\"Successfully updated DuckDNS with new IP \".\$c\
urrentIP);\r\
\n } else={\r\
\n :log error (\"Failed to update DuckDNS with new IP \".\$curr\
entIP);\r\
\n }\r\
\n }\r\
\n}\r\
\n"
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=none
/tool mac-server ping
set enabled=no |