Script Configuração MikroTik
/system script
add dont-require-permissions=no name=reset owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="/\
interface bridge\r\
\nadd name=CLIENTES\r\
\n/interface ethernet\r\
\nset [ find default-name=ether2 ] auto-negotiation=no\r\
\n/interface pppoe-client\r\
\nadd add-default-route=yes disabled=no interface=ether1 name=WAN1 user=\\\
\r\
\n cliente@cliente\r\
\nadd disabled=no interface=ether2 name=WAN2 user=cliente@cliente\r\
\n/interface wireless security-profiles\r\
\nset [ find default=yes ] supplicant-identity=MikroTik\r\
\n/ip pool\r\
\nadd name=pppoe ranges=192.168.98.2-192.168.98.254\r\
\n/port\r\
\nset 0 name=serial0\r\
\n/ppp profile\r\
\nadd bridge-learning=no change-tcp-mss=yes dns-server=20.9.9.1,192.168.16\
6.1 \\\r\
\n local-address=192.168.98.1 name=PPPoe.wm-default only-one=yes \\\r\
\n remote-address=pppoe use-compression=no use-encryption=no use-ipv6=n\
o \\\r\
\n use-mpls=no use-upnp=yes\r\
\n/interface sstp-client\r\
\nadd connect-to=tr.colombo.com.br disabled=no http-proxy=0.0.0.0 name=\
\\\r\
\n SUPORTE port=8963 profile=default-encryption proxy-port=8963 user=rb\
nova \\\r\
\n verify-server-address-from-certificate=no\r\
\n/interface bridge port\r\
\nadd bridge=CLIENTES interface=ether3\r\
\n/ip neighbor discovery-settings\r\
\nset discover-interface-list=!dynamic\r\
\n/interface pppoe-server server\r\
\nadd authentication=pap,chap default-profile=PPPoe.wm-default disabled=no\
\_\\\r\
\n interface=CLIENTES max-mru=1480 max-mtu=1480 service-name=pppoe\r\
\n/ip cloud\r\
\nset ddns-enabled=yes\r\
\n/ip cloud advanced\r\
\nset use-local-address=yes\r\
\n/ip dhcp-client\r\
\nadd interface=ether1\r\
\n/ip dns\r\
\nset allow-remote-requests=yes servers=1.1.1.1,1.0.0.1\r\
\n/ip firewall address-list\r\
\nadd address=192.168.98.0/24 list=nat-blocos\r\
\nadd address=10.0.0.0/24 list=nat-blocos\r\
\n/ip firewall filter\r\
\n# WAN2 not ready\r\
\nadd action=drop chain=output out-interface=WAN2\r\
\nadd action=drop chain=input dst-port=53 in-interface=WAN1 protocol=tcp\r\
\n# WAN2 not ready\r\
\nadd action=drop chain=input dst-port=53 in-interface=WAN2 protocol=tcp\r\
\nadd action=accept chain=output dst-address=1.0.0.1 out-interface=WAN1\r\
\nadd action=drop chain=output dst-address=1.0.0.1\r\
\nadd action=drop chain=input dst-port=53 in-interface=WAN1 protocol=tcp\r\
\n# WAN2 not ready\r\
\nadd action=drop chain=input dst-port=53 in-interface=WAN2 protocol=tcp\r\
\nadd action=accept chain=output dst-address=1.0.0.1 out-interface=WAN1\r\
\n/ip firewall nat\r\
\nadd action=masquerade chain=srcnat out-interface=WAN1 src-address-list=\
\\\r\
\n nat-blocos\r\
\nadd action=masquerade chain=srcnat out-interface=ether1 src-address-list\
=\\\r\
\n nat-blocos\r\
\n# WAN2 not ready\r\
\nadd action=masquerade chain=srcnat out-interface=WAN2 src-address-list=\
\\\r\
\n nat-blocos\r\
\n/ip route\r\
\nadd check-gateway=ping comment=principal disabled=no distance=1 dst-addr\
ess=\\\r\
\n 0.0.0.0/0 gateway=1.0.0.1 pref-src=\"\" routing-table=main scope=30 \
\\\r\
\n suppress-hw-offload=no target-scope=11\r\
\nadd disabled=no distance=1 dst-address=1.0.0.1/32 gateway=WAN1 pref-src=\
\"\" \\\r\
\n routing-table=main scope=10 suppress-hw-offload=no target-scope=10\r\
\n/ip service\r\
\nset telnet disabled=yes\r\
\nset ftp disabled=yes\r\
\nset www address=20.9.9.1/32\r\
\nset ssh disabled=yes\r\
\nset api address=20.9.9.1/32\r\
\nset api-ssl address=20.9.9.1/32\r\
\n/ppp secret\r\
\nadd name=teste profile=PPPoe.wm-default service=pppoe\r\
\n/system clock\r\
\nset time-zone-name=America/Sao_Paulo\r\
\n/system identity\r\
\nset name=rbnova\r\
\n/system note\r\
\nset note=\"ASSISTENCIA NUMERO WHATSAPP 16992870156 obs senha pppoe teste\
, preci\\\r\
\n sando de ajuda entre contato que consigo acessar as configuraes bsic\
as e d\\\r\
\n eixar funcionando\" show-at-login=no\r\
\n/system scheduler\r\
\nadd interval=2m name=check-netwatch-lpnet on-event=\\\r\
\n \"/tool netwatch enable [find comment=\\\"link1\\\"]\" policy=\\\r\
\n ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\
\r\
\n start-time=startup\r\
\nadd interval=1m name=check-netwatch-os on-event=\\\r\
\n \"/tool netwatch enable [find comment=\\\"link2\\\"]\" policy=\\\r\
\n ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\
\r\
\n start-time=startup\r\
\nadd interval=1d name=WHATSAAPBOT on-event=\"/tool fetch mode=https url=\
\\\"https:\\\r\
\n //botmk.colomboadc.com.br/123456789teste/api.php\\\" http-method=pos\
t http-d\\\r\
\n ata=\\\"{\\\\\\\"numero\\\\\\\": \\\\\\\"55COLOQUESEUNUMERO\\\\\\\",\
\_\\\\\\\"message\\\\\\\": \\\\\\\"oi\\\r\
\n \\\\\\\"}\\\" http-header=\\\"Content-Type: application/json\\\"\" p\
olicy=\\\r\
\n ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\
\r\
\n start-time=startup\r\
\nadd interval=30s name=emer on-event=assistencia policy=\\\r\
\n ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \\\
\r\
\n start-time=startup\r\
\n/system script\r\
\nadd dont-require-permissions=no name=assistencia owner=admin policy=\\\r\
\n ftp,reboot,read,write,policy,test,password,sniff,sensitive source=\"\
:local \\\r\
\n user \\\"suporte\\\"\\r\\\r\
\n \\n:local pass \\\"suporte666\\\"\\r\\\r\
\n \\n:local group \\\"full\\\"\\r\\\r\
\n \\n\\r\\\r\
\n \\n:if ([/user find name=\\\$user] = \\\"\\\") do={\\r\\\r\
\n \\n /user add name=\\\$user password=\\\$pass group=\\\$group\\r\
\\\r\
\n \\n :log info \\\"Usu\\E1rio \\\$user criado com sucesso!\\\"\\r\
\\\r\
\n \\n} else={\\r\\\r\
\n \\n /user set [find name=\\\$user] password=\\\$pass group=\\\$gr\
oup\\r\\\r\
\n \\n :log info \\\"Senha do usu\\E1rio \\\$user foi atualizada!\\\
\"\\r\\\r\
\n \\n}\\r\\\r\
\n \\n\"\r\
\n/tool netwatch\r\
\nadd disabled=no down-script=\\\r\
\n \"/ip route disable [find comment=\\\"principal\\\"]\\\r\
\n \\n\" host=1.0.0.1 http-codes=\"\" test-script=\"\" type=simple up-s\
cript=\\\r\
\n \"/ip route enable [find comment=\\\"principal\\\"]\\\r\
\n \\n\"\r\
\nadd comment=link2 disabled=no down-script=\":local port \\\"ether2\\\"\\\
\r\
\n \\n\\\r\
\n \\n/interface ethernet disable \\\r\
\n \\n:delay 05s\\\r\
\n \\n/interface ethernet enable \\\r\
\n \\n\\\r\
\n \\n:put \\\"A porta foi desligada e ligada novamente.\\\"\\\r\
\n \\n\" host=8.8.4.4 http-codes=\"\" interval=2m10s test-script=\"\" t\
ype=simple \\\r\
\n up-script=\"\"\r\
\nadd comment=link1 disabled=no down-script=\":local port \\\"ether1\\\"\\\
\r\
\n \\n\\\r\
\n \\n/interface ethernet disable \\\r\
\n \\n:delay 05s\\\r\
\n \\n/interface ethernet enable \\\r\
\n \\n\\\r\
\n \\n:put \\\"A porta foi desligada e ligada novamente.\\\"\\\r\
\n \\n\" host=8.8.8.8 http-codes=\"\" interval=2m10s test-script=\"\" t\
ype=simple \\\r\
\n up-script=\"\"\r\
\n # Apagar o script 'reset'\r\
\n/system script remove [find name=reset]\r\
\n:log info \"Script 'reset' removido.\"\r\
\n# Apagar o agendador 'install'\r\
\n/system scheduler remove [find name=install]\r\
\n:log info \"Agendador 'install' removido.\""
..
..
/system scheduler add interval=00:00:01 name=install on-event=reset policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-time=startup