/interface bridge add dhcp-agent-circuit-id="interface: \$(INTERFACE)" dhcp-agent-remote-id= "name: \$(HOSTNAME)" dhcp-snooping=yes name=bridge1 vlan-filtering=no / /interface bridge port add bridge=bridge1 interface=ether2 trusted=no add bridge=bridge1 interface=ether3 trusted=no add bridge=bridge1 interface=ether4 trusted=no add bridge=bridge1 interface=ether5 trusted=no / /ip dhcp-client add interface=ether1 name=ISP / /ip dns set allow-remote-requests=yes / /ip address add interface=bridge1 address=10.104.3.1/26 comment=Lan / /ip pool add name=pool1-Lan ranges=10.104.3.2-10.104.3.63 / /ip dhcp-server add address-pool=dhcp_pool1 interface=bridge1 name=dhcp1 / /ip dhcp-server network add address=10.104.3.0/26 dns-server=10.104.3.1 gateway=10.104.3.1 / /interface list add name=WAN add name=MGMNT add name=LAN add name=Wifi add name=TUN / /interface list member add interface=ether1 list=WAN add interface=ether2 list=LAN add interface=ether3 list=LAN add interface=ether4 list=LAN add interface=ether5 list=LAN / /ip service set telnet disabled=yes set ftp disabled=yes set api disabled=yes set api-ssl disabled=yes set www disabled=yes set ssh port=55 / /interface wifi channel add band=2ghz-ax disabled=no frequency=2412,2437,2462,2472 name=channel_24Ghz_AX width=20mhz add band=2ghz-n disabled=no frequency=2412,2437,2462,2472 name=channel_24Ghz_N width=20mhz add band=5ghz-ax disabled=no frequency=5180,5200,5220,5240 name=channel_5Ghz_AX_bc secondary-frequency=disabled width=20mhz add band=5ghz-ac disabled=no frequency=5180,5200,5220,5240 name=channel_5Ghz_AC_bc secondary-frequency=disabled width=20mhz / /interface wifi datapath add bridge=bridge1 disabled=no name=datapath1-corp-AX interface-list=Wifi add bridge=bridge1 disabled=no name=datapath2-corp-AC interface-list=Wifi / /interface wifi security add authentication-types=wpa2-psk disabled=no name=sec1-corp-Wifi / /interface wifi configuration add channel=channel_24Ghz_AX datapath=datapath1-corp-AX disabled=no name=cfg1-work_2AX security=sec1-corp-Wifi add channel=channel_24Ghz_N datapath=datapath2-corp-AC disabled=no name=cfg2-work_2AC security=sec1-corp-Wifi add channel=channel_5Ghz_AX_bc datapath=datapath1-corp-AX disabled=no name=cfg3-work_5AX security=sec1-corp-Wifi add channel=channel_5Ghz_AC_bc datapath=datapath1-corp-AX disabled=no name=cfg4-work_5AC security=sec1-corp-Wifi / /interface wifi provisioning add action=create-dynamic-enabled comment=corp_2AX disabled=no name-format=2.4Ghz-corp-AX-%I radio-mac=00:00:00:00:00:00 supported-bands=2ghz-ax add action=create-dynamic-enabled comment=corp_2AC disabled=no name-format=2.4Ghz-corp-AC-%I radio-mac=00:00:00:00:00:00 supported-bands=2ghz-n add action=create-dynamic-enabled comment=corp_5AC disabled=no name-format=5Ghz-corp-AC-%I radio-mac=00:00:00:00:00:00 supported-bands=5ghz-ac add action=create-dynamic-enabled comment=corp_5AX disabled=no name-format=5Ghz-corp-AX-%I radio-mac=00:00:00:00:00:00 supported-bands=5ghz-ax / /ip firewall address-list add address=he108n83ftx.sn.mynetname.net list=access_admin add address=d8370cbd37df.sn.mynetname.net list=access_admin add address=85.113.37.212 list=access_admin add address=529f028d4cc5.sn.mynetname.net list=access_admin / /ip firewall filter add action=fasttrack-connection chain=input connection-state=established,related add action=accept chain=input comment=RELATED,ESTABLISHED connection-state=established,related add action=fasttrack-connection chain=forward connection-state=established,related add action=accept chain=forward comment=RELATED,ESTABLISHED connection-state=established,related add action=drop chain=forward comment=Invalid connection-state=invalid in-interface-list=WAN log-prefix=FWD/Invalid drop add action=drop chain=input comment=Invalid connection-state=invalid in-interface-list=WAN log-prefix=In/Invalid_DROP add action=accept chain=input comment=ICMP_input icmp-options=8:0 packet-size=0-128 protocol=icmp add action=accept chain=input in-interface-list=LAN add action=accept chain=input in-interface-list=Wifi add action=accept chain=input in-interface-list=MGMNT add action=accept chain=forward in-interface-list=MGMNT add action=accept chain=forward in-interface-list=LAN add action=accept chain=forward in-interface-list=Wifi add action=accept chain=input comment=allow_admin_ADI connection-state=new dst-port=8291,55 protocol=tcp src-address-list=access_admin add action=drop chain=input log-prefix=Input_DROP add action=accept chain=forward comment=DNAT from WAN connection-nat-state=dstnat in-interface-list=WAN add action=drop chain=forward connection-nat-state=!dstnat connection-state=new log=yes log-prefix=FORWARD/drop / /ip firewall nat add chain=srcnat out-interface=ether1 action=masquerade comment=ISP / /tool romon set enabled=yes secrets=okTTu8A4 /tool romon port add interface=LAN set [ find default=yes ] forbid=yes / /system script add dont-require-permissions=yes name=Backup_mail owner=volkov_em policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="{\r\ \n#Email account settings\r\ \n:local smtpserv [:resolve \"smtp.mail.ru\"];\r\ \n:local EaccountFrom \"mikrotik@adi63.ru\";\r\ \n:local EaccountTo \"mikrotik@adi63.ru\";\r\ \n:local pass \"G5mGug6XEy7mZaxWVDPw\";\r\ \n\r\ \n#Getting information about the system and deleting old backups\r\ \n:log info \"Starting Backup Script...\";\r\ \n:local sysname [/system/identity/get name];\r\ \n:local sysver [system/package/get routeros version];\r\ \n:log info \"Flushing DNS cache...\";\r\ \n/ip dns cache flush;\r\ \n:delay 2;\r\ \n:log info \"Deleting last Backups...\";\r\ \n:foreach i in=[/file find] do={:if ([:typeof [:find [/file get \$i name] \ \"\$sysname-backup-\"]]!=\"nil\") do={/file remove \$i}};\r\ \n:delay 2;\r\ \n\r\ \n#Create and E-mail Full Backup\r\ \n:local backupfile (\"\$sysname-backup-\" . [:pick [/system clock get date]\ \_7 11] . [:pick [/system clock get date] 0 3] . [:pick [/system clock get d\ ate] 4 6] . \".backup\");\r\ \n:log info \"Creating new Full Backup file...\";\r\ \n/system backup save name=\$backupfile;\r\ \n:delay 2;\r\ \n:log info \"Sending Full Backup file via E-mail...\";\r\ \n/tool e-mail send from=\$EaccountFrom to=\$EaccountTo server=\$smtpserv po\ rt=587 user=\$EaccountFrom password=\$pass tls=starttls file=\$backupfile su\ bject=(\"\$sysname Full Backup (\" . [/system clock get date] . \")\") body=\ (\"\$sysname full Backup file see in attachment. RouterOS \$sysver\");\r\ \n:delay 5;\r\ \n\r\ \n#Create and E-mail Config Backup\r\ \n:local exportfile (\"\$sysname-backup-\" . [:pick [/system clock get date]\ \_7 11] . [:pick [/system clock get date] 0 3] . [:pick [/system clock get d\ ate] 4 6] . \".rsc\");\r\ \n:log info \"Creating new Setup Script file...\";\r\ \n/export file=\$exportfile;\r\ \n:delay 2;\r\ \n:log info \"Sending Setup Script file via E-mail...\";\r\ \n/tool e-mail send from=\$EaccountFrom to=\$EaccountTo server=\$smtpserv po\ rt=587 user=\$EaccountFrom password=\$pass tls=starttls file=\$exportfile su\ bject=(\"\$sysname Config Script Backup (\" . [/system clock get date] . \")\ \") body=(\"\$sysname Config Script file see in attachment. RouterOS \$sysve\ r\");\r\ \n:delay 5;\r\ \n\r\ \n#Finish\r\ \n:log info \"All System Backups successfully sent. Backup is complete.\";\r\ \n}" / #Sheduler /system scheduler add interval=4w2d name=Backup on-event="/system script run Backup_mail" policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \ start-date=2025-04-30 start-time=23:00:00 / /system ntp client set enabled=yes /system ntp client servers add address=0.ru.pool.ntp.org add address=1.ru.pool.ntp.org / /system clock set time-zone-name=Europe/Samara / /snmp community add addresses=192.168.31.116/32,172.30.31.70/32,172.30.31.102/32 name=8XHW4NyLmo /snmp set enabled=yes trap-community=8XHW4NyLmo trap-version=2 set enabled=yes /