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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
| # may/20/2022 14:02:01 by RouterOS 6.49.5
# software id = S62Z-5GTT
#
# model = 2011UiAS-2HnD
# serial number = 4D4B0465FEA6
/interface bridge
add name=bridge-guest
add fast-forward=no name=bridge-lan
/interface ethernet
set [ find default-name=ether1 ] mac-address=00:F2:90:65:64:DC name=\
ether01-wan speed=100Mbps
set [ find default-name=ether2 ] name=ether02 speed=100Mbps
set [ find default-name=ether3 ] name=ether03 speed=100Mbps
set [ find default-name=ether4 ] name=ether04 speed=100Mbps
set [ find default-name=ether5 ] name=ether05 speed=100Mbps
set [ find default-name=ether6 ] advertise=\
10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=ether06
set [ find default-name=ether7 ] advertise=\
10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=ether07
set [ find default-name=ether8 ] advertise=\
10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=ether08
set [ find default-name=ether9 ] advertise=\
10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=ether09
set [ find default-name=ether10 ] advertise=\
10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full poe-out=off
set [ find default-name=sfp1 ] name=sfp
/interface vlan
add interface=bridge-guest name=vlan30-bridge-guests use-service-tag=yes \
vlan-id=30
add name=vlan30-wlan-guest use-service-tag=yes vlan-id=30
/interface list
add exclude=dynamic name=discover
add name=mactel
add name=mac-winbox
add name=WAN
add name=LAN
add name=GUEST
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk eap-methods="" mode=\
dynamic-keys supplicant-identity=MikroTik
add authentication-types=wpa2-psk eap-methods="" management-protection=\
allowed mode=dynamic-keys name=profile-guest supplicant-identity=""
add authentication-types=wpa-psk,wpa2-psk eap-methods="" \
management-protection=allowed mode=dynamic-keys name=profile-private-wifi \
supplicant-identity=""
add authentication-types=wpa-psk eap-methods="" management-protection=allowed \
mode=dynamic-keys name=profile-gaming supplicant-identity=""
/interface wireless
set [ find default-name=wlan1 ] antenna-gain=0 band=2ghz-b/g/n \
basic-rates-a/g=24Mbps,36Mbps,48Mbps,54Mbps basic-rates-b=5.5Mbps,11Mbps \
country=no_country_set disabled=no frequency=2462 mac-address=\
4C:5E:0C:49:43:54 mode=ap-bridge name=wlan-private-wifi radio-name="" \
security-profile=profile-private-wifi ssid=private-wifi station-roaming=enabled \
supported-rates-a/g=24Mbps,36Mbps,48Mbps,54Mbps supported-rates-b=\
5.5Mbps,11Mbps tx-power=27 tx-power-mode=all-rates-fixed wps-mode=\
disabled
add disabled=no keepalive-frames=disabled mac-address=4E:5E:0C:49:43:54 \
master-interface=wlan-private-wifi multicast-buffering=disabled name=\
wlan-guest security-profile=profile-guest ssid=guest-wifi vlan-id=\
30 wds-cost-range=0 wds-default-cost=0 wps-mode=disabled
/ip dhcp-server option
add code=150 name=customtftp value=0xC0A806D2
add code=67 name=bootfile value="'pxelinux.0'"
/ip pool
add name=pool-lan ranges=192.168.6.20-192.168.6.49
add name=pool-vpn ranges=192.168.89.20-192.168.89.29
add name=pool-guests ranges=192.168.66.10-192.168.66.50
add name=pool-vpn-home ranges=192.168.80.20-192.168.80.29
/ip dhcp-server
add address-pool=pool-lan authoritative=after-2sec-delay disabled=no \
interface=bridge-lan lease-time=5m name=dhcp-lan
add address-pool=pool-guests disabled=no interface=bridge-guest lease-time=1h \
name=dhcp-guest
/ppp profile
set *0 local-address=192.168.89.1 remote-address=pool-vpn
add change-tcp-mss=yes local-address=192.168.80.1 name="vpn profile home" \
remote-address=pool-vpn-home
add local-address=pool-guests name=profile-ppoe remote-address=pool-guests \
use-encryption=yes
set *FFFFFFFE local-address=192.168.89.1 remote-address=pool-vpn
/snmp community
set [ find default=yes ] addresses=0.0.0.0/0
/user group
set full policy="local,telnet,ssh,ftp,reboot,read,write,policy,test,winbox,pas\
sword,web,sniff,sensitive,api,romon,dude,tikapp"
/interface bridge filter
# no interface
add action=drop chain=forward in-interface=*E
# no interface
add action=drop chain=forward out-interface=*E
/interface bridge port
add bridge=bridge-lan interface=ether03
add bridge=bridge-lan interface=ether04
add bridge=bridge-lan interface=ether07
add bridge=bridge-lan interface=ether06
add bridge=bridge-lan interface=ether08
add bridge=bridge-lan interface=ether09
add bridge=bridge-lan interface=ether10
add bridge=bridge-lan interface=sfp
add bridge=bridge-lan interface=wlan-private-wifi
add bridge=bridge-lan interface=ether02
add bridge=bridge-guest interface=vlan30-bridge-guests
add bridge=bridge-guest interface=vlan30-wlan-guest
add bridge=bridge-guest interface=wlan-guest
add bridge=bridge-lan interface=ether05
/ip neighbor discovery-settings
set discover-interface-list=none
/interface detect-internet
set detect-interface-list=all
/interface l2tp-server server
set authentication=chap,mschap2 default-profile="vpn profile home" \
enabled=yes max-sessions=5 use-ipsec=yes
/interface list member
add interface=sfp list=discover
add interface=ether02 list=discover
add interface=ether03 list=discover
add interface=ether04 list=discover
add interface=ether05 list=discover
add interface=ether06 list=discover
add interface=ether07 list=discover
add interface=ether08 list=discover
add interface=ether09 list=discover
add interface=ether10 list=discover
add interface=wlan-private-wifi list=discover
add interface=bridge-lan list=discover
add interface=vlan30-bridge-guests list=discover
add interface=ether02 list=mac-winbox
add interface=ether03 list=mac-winbox
add interface=ether04 list=mac-winbox
add interface=ether05 list=mac-winbox
add interface=ether06 list=mac-winbox
add interface=ether07 list=mac-winbox
add interface=ether08 list=mac-winbox
add interface=ether09 list=mac-winbox
add interface=ether10 list=mac-winbox
add interface=sfp list=mac-winbox
add interface=wlan-private-wifi list=mac-winbox
add interface=ether01-wan list=WAN
add interface=bridge-lan list=LAN
add interface=bridge-guest list=GUEST
/interface ovpn-server server
set auth=sha1 certificate=Server cipher=aes256 default-profile=\
"vpn profile home" require-client-certificate=yes
/interface pptp-server server
set authentication=pap,chap,mschap1,mschap2 default-profile=default
/interface sstp-server server
set default-profile=default-encryption
/interface wireless access-list
/ip address
add address=192.168.6.165/24 interface=bridge-lan network=192.168.6.0
add address=192.168.66.165/24 interface=bridge-guest network=192.168.66.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-client
add disabled=no interface=ether01-wan
/ip dhcp-server config
set store-leases-disk=8h
/ip dhcp-server lease
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.6.0/24 list=masquerade
add address=192.168.66.0/24 list=masquerade
add address=192.168.80.0/24 list=masquerade
add address=192.168.89.0/24 list=masquerade
/ip firewall filter
add action=drop chain=forward comment="drop invalid state" connection-state=\
invalid
add action=drop chain=input comment="drop invalid state" connection-state=\
invalid
add action=drop chain=output comment="drop invalid state" connection-state=\
invalid
add action=drop chain=forward comment="block network to guests" dst-address=\
192.168.66.0/24 src-address=192.168.6.0/24
add action=drop chain=forward comment="block guests to network" dst-address=\
192.168.6.0/24 src-address=192.168.66.0/24
add action=accept chain=input comment="input btest" disabled=yes dst-port=\
2000 protocol=tcp src-address-list=allow-extern-ips
add action=accept chain=input comment="input btest access from adreslist" \
disabled=yes dst-port=2000 protocol=tcp src-address-list=allow-extern-ips
add action=accept chain=input comment="input winbox access from adreslist 80" \
disabled=yes dst-port=80 protocol=tcp src-address-list=allow-extern-ips \
src-port=8085
add action=accept chain=input comment="allow ovpn 1194" disabled=yes \
dst-port=1194 protocol=tcp
add action=accept chain=input comment="allow pptp" disabled=yes dst-port=1723 \
protocol=tcp
add action=accept chain=input comment="allow sstp" disabled=yes dst-port=443 \
protocol=tcp
add action=accept chain=input protocol=icmp
add action=accept chain=input connection-state=established
add action=accept chain=input connection-state=related
add action=accept chain=input comment="input winbox access from adreslist" \
dst-port=8291 protocol=tcp src-address-list=allow-extern-ips
add action=accept chain=input comment="input pptp access from adreslist" \
disabled=yes dst-port=1723 protocol=tcp src-address-list=allow-extern-ips
add action=accept chain=input comment="allow l2tp udp 1701" dst-port=1701 \
protocol=udp
add action=accept chain=input comment="allow l2tp udp 4500" dst-port=4500 \
protocol=udp
add action=accept chain=input comment="allow l2tp udp 500" dst-port=500 \
protocol=udp
add action=fasttrack-connection chain=forward connection-state=\
established,related
add action=accept chain=forward connection-state=established,related
add action=drop chain=forward connection-nat-state=!dstnat connection-state=\
new in-interface-list=WAN
add action=drop chain=input in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="masq traffic" out-interface=\
ether01-wan src-address-list=masquerade
add action=masquerade chain=srcnat comment="masq. vpn traffic" disabled=yes \
src-address=192.168.89.0/24
add action=masquerade chain=srcnat comment="masq. vpn traffic home" \
disabled=yes src-address=192.168.80.0/24
add action=dst-nat chain=dstnat comment="forward to domoticz 8080 > 8080" \
dst-port=8208 protocol=tcp src-address-list=allow-extern-ips \
to-addresses=192.168.6.208 to-ports=8080
add action=dst-nat chain=dstnat comment="forward to domoticz 22 > 22" \
dst-port=22 protocol=tcp src-address-list=allow-extern-ips to-addresses=\
192.168.6.208 to-ports=22
add action=dst-nat chain=dstnat comment="forward to pv-voor-logger 8081 > 80" \
dst-port=8201 protocol=tcp src-address-list=allow-extern-ips \
to-addresses=192.168.6.201 to-ports=80
add action=dst-nat chain=dstnat comment=\
"forward to pv-achter-logger 8082 >80" dst-port=8202 protocol=tcp \
src-address-list=allow-extern-ips to-addresses=192.168.6.202 to-ports=80
add action=dst-nat chain=dstnat comment=\
"forward to pv-garage2-logger 8203 >80" dst-port=8203 protocol=tcp \
src-address-list=allow-extern-ips to-addresses=192.168.6.203 to-ports=80
add action=dst-nat chain=dstnat comment=\
"forward to shelly-vloerverwarmin 8121 >80" dst-port=8121 protocol=tcp \
src-address-list=allow-extern-ips to-addresses=192.168.6.121 to-ports=80
add action=dst-nat chain=dstnat comment="forward to nas 5000>5000" dst-port=\
5000 protocol=tcp src-address-list=allow-extern-ips to-addresses=\
192.168.6.240 to-ports=5000
add action=dst-nat chain=dstnat comment="forward to nas 80>80" disabled=yes \
dst-port=80 protocol=tcp src-address-list=allow-extern-ips to-addresses=\
192.168.6.240 to-ports=80
add action=dst-nat chain=dstnat comment="forward to nas 5000>5000 nzbget" \
dst-port=6789 protocol=tcp src-address-list=allow-extern-ips \
to-addresses=192.168.6.240 to-ports=6789
add action=dst-nat chain=dstnat comment="forward rsync nijm82 -> nas" \
disabled=yes dst-port=873 protocol=tcp src-address-list=allow-extern-ips \
to-addresses=192.168.6.240 to-ports=873
add action=dst-nat chain=dstnat comment=\
"forward to winbox 8292 > 8291 ip 166" dst-port=8292 protocol=tcp \
src-address-list=allow-extern-ips to-addresses=192.168.6.166 to-ports=\
8291
add action=dst-nat chain=dstnat comment=\
"forward to winbox 8293 > 8291 ip 167" dst-port=8293 protocol=tcp \
src-address-list=allow-extern-ips to-addresses=192.168.6.167 to-ports=\
8291
/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 service
set telnet disabled=yes
set ftp disabled=yes
set api disabled=yes
set api-ssl disabled=yes
/ip ssh
set allow-none-crypto=yes forwarding-enabled=remote
/ip upnp interfaces
add interface=bridge-lan type=internal
add interface=ether01-wan type=external
add interface=bridge-guest type=internal
/lcd
set enabled=no touch-screen=disabled
/ppp secret
add disabled=yes name=vpn
add name=user1 profile="vpn profile home"
add disabled=yes name=user2 profile="vpn profile home" \
service=l2tp
add disabled=yes name=user3 profile="vpn profile home" service=\
l2tp
add disabled=yes local-address=192.168.89.1 name=user4 remote-address=\
192.168.89.100 service=l2tp
add disabled=yes name=user5 profile="vpn profile home" service=l2tp
add disabled=yes name=user6 profile="vpn profile home" service=ovpn
add disabled=yes name=user7 profile="vpn profile home" service=pptp
add disabled=yes name=user8 service=l2tp
add disabled=yes name=ppoe profile=profile-ppoe service=pppoe
/system clock
set time-zone-name=Europe/Amsterdam
/system identity
set name=RB2011-home
/system logging
set 0 disabled=yes
set 1 disabled=yes
set 3 disabled=yes
/system ntp client
set enabled=yes primary-ntp=185.51.192.34 secondary-ntp=91.148.192.49
/system scheduler
add comment="Update No-IP DDNS" interval=2h name=no-ip_ddns_update on-event=\
no-ip_ddns_update policy=read,write,test start-date=mar/14/2017 \
start-time=17:45:32
add comment="static adresses naar dns" interval=3d18h name=dhcp2dns on-event=\
dhcp2dns policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
start-date=nov/29/2018 start-time=17:00:00
/system script
add comment="no-ip domain update" dont-require-permissions=no name=\
no-ip_ddns_update owner=admin policy=read,write,test source="# No-IP autom\
atic Dynamic DNS update\r\
\n\r\
\n#--------------- Change Values in this section to match your setup -----\
-------------\r\
\n\r\
\n# No-IP User account info\r\
\n:local noipuser \"user-mail.nl\"\r\
\n:local noippass \"wachtwoord\"\r\
\n\r\
\n# Set the hostname or label of network to be updated.\r\
\n# Hostnames with spaces are unsupported. Replace the value in the quotat\
ions below with your host names.\r\
\n# To specify multiple hosts, separate them with commas.\r\
\n:local noiphost \"dydns.domein.nl\"\r\
\n\r\
\n# Change to the name of interface that gets the dynamic IP address\r\
\n:local inetinterface \"ether01-wan\"\r\
\n\r\
\n#-----------------------------------------------------------------------\
-------------\r\
\n# No more changes need\r\
\n\r\
\n#:global previousIP;\r\
\n\r\
\n:if ([/interface get \$inetinterface value-name=running]) do={\r\
\n# Get the current IP on the interface\r\
\n :local currentIP [/ip address get [find interface=\"\$inetinterface\"\
\_disabled=no] address];\r\
\n\r\
\n# Strip the net mask off the IP address\r\
\n :for i from=( [:len \$currentIP] - 1) to=0 do={\r\
\n :if ( [:pick \$currentIP \$i] = \"/\") do={\r\
\n :set currentIP [:pick \$currentIP 0 \$i];\r\
\n }\r\
\n }\r\
\n\r\
\n :local previousIP [:resolve \"\$noiphost\"];\r\
\n\r\
\n :log info \"DNS IP: \$previousIP, interface IP: \$currentIP\";\r\
\n\r\
\n :if (\$currentIP != \$previousIP) do={\r\
\n :log info \"No-IP: Current IP \$currentIP is not equal to previous\
\_IP \$previousIP, update needed\";\r\
\n # :set previousIP \$currentIP;\r\
\n :local url \"http://dynupdate.no-ip.com/nic/update\\3Fmyip=\$curre\
ntIP\";\r\
\n :log info \"No-IP: Sending update for \$noiphost\";\r\
\n /tool fetch url=(\$url . \"&hostname=\$noiphost\") user=\$noipuser\
\_password=\$noippass mode=http dst-path=(\"no-ip_ddns_update-\" . \$host \
. \".txt\")\r\
\n :log info \"No-IP: Host \$noiphost updated on No-IP with IP \$curr\
entIP\";\r\
\n \r\
\n } else={\r\
\n :log info \"No-IP: Previous IP \$previousIP is equal to current IP, n\
o update needed\";\r\
\n }\r\
\n} else={\r\
\n :log info \"No-IP: \$inetinterface is not currently running, so there\
fore will not update.\";\r\
\n}"
add comment="local static 2 dns" dont-require-permissions=no name=dhcp2dns \
owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="#\
\_Domain to be added to your DHCP-clients hostname\r\
\n:local topdomain;\r\
\n:set topdomain \"local.homeers.nl\";\r\
\n\r\
\n# Use ttl to distinguish dynamic added DNS records\r\
\n:local ttl;\r\
\n:set ttl \"00:59:59\";\r\
\n\r\
\n# Set variables to use\r\
\n:local hostname;\r\
\n:local hostip;\r\
\n:local free;\r\
\n\r\
\n# Remove all dynamic records\r\
\n/ip dns static;\r\
\n:foreach a in=[find] do={\r\
\n :if ([get \$a ttl] = \$ttl) do={\r\
\n :put (\"Removing: \" . [get \$a name] . \" : \" . [get \$a address])\
;\r\
\n remove \$a;\r\
\n }\r\
\n}\r\
\n\r\
\n/ip dhcp-server lease ;\r\
\n:foreach i in=[find] do={\r\
\n /ip dhcp-server lease ;\r\
\n :if ([:len [get \$i host-name]] > 0) do={\r\
\n :set free \"true\";\r\
\n :set hostname ([get \$i host-name] . \".\" . \$topdomain);\r\
\n :set hostip [get \$i address];\r\
\n /ip dns static ;\r\
\n# Check if entry already exist\r\
\n :foreach di in [find] do={\r\
\n :if ([get \$di name] = \$hostname) do={\r\
\n :set free \"false\";\r\
\n :put (\"Not adding already existing entry: \" . \$hostname);\r\
\n }\r\
\n }\r\
\n :if (\$free = true) do={\r\
\n :put (\"Adding: \" . \$hostname . \" : \" . \$hostip ) ;\r\
\n /ip dns static add name=\$hostname address=\$hostip ttl=\$ttl;\r\
\n }\r\
\n }\r\
\n}"
/tool bandwidth-server
set authenticate=no enabled=no
/tool graphing
set store-every=24hours
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=LAN
/tool mac-server ping
set enabled=no |