+ Responder ao Tópico



  1. #1

    Padrão Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

  2. #2

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Porque nao utiliza a função cloud da RB?

    ip/cloud

  3. #3

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Boa noite faeldantas

    /ip cloud da RB funciona atrás de Nat ?
    Lembro que tentei usar essa funcionalidade, mas não funcionou como o esperado.


    Acompanhando.

  4. #4

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Citação Postado originalmente por jaksonp Ver Post
    Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!
    Usa este https://under-linux.org/showthread.php?t=179607

  5. #5

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Olá, amigos... aproveitando a dúvida do colega, o Change IP está com algum problema? Desde semana passada quando tento acessar remotamente o MK, aparece a seguinte mensagem no winbox: "ERROR: could not connect to..."

    Alguém mais está passando por esse problema?

    Abraço.

  6. #6

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Deve estar sim!Meu script não funciona mais. Já tentei todos os possíveis!

  7. #7

  8. #8

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Então qual seria a solução para contornar esse problema de script? Tenho 2 servidores com versões mais antigas do MK e por enquanto não quero arriscar uma atualização e ficar com a rede parada por algum problema durante o processo.

    Abraço.

  9. #9

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Amigão, vai de boa nesse aqui, testado e aprovado tanto nas versões 5.26 e 6.29.1:

    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # EDIT YOUR DETAILS / CONFIGURATION HERE
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    :global ddnsuser "USER-CHANGEIP"
    :global ddnspass "SENHA-CHANGEIP"
    :global ddnshost "HOST-CHANGEIP"
    :global ddnsinterface "INTERFACE"
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # END OF USER DEFINED CONFIGURATION
    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    :global ddnssystem ("mt-" . [/system package get [/system package find name=system] version] )
    :global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface] address ]
    :global ddnslastip


    :if ([:len [/interface find name=$ddnsinterface]] = 0 ) do={ :log info "ChangeIP: Nenhuma interface $ddnsinterface, por favor cheque a configuração." }


    :if ([ :typeof $ddnslastip ] = "nothing" ) do={ :global ddnslastip 0.0.0.0/0 }


    :if ([ :typeof $ddnsip ] = "nothing" ) do={


    :log info ("ChangeIP: Sem IP na Interface " . $ddnsinterface . ", por favor verifique.")


    } else={


    :if ($ddnsip != $ddnslastip) do={


    :log info "ChangeIP: Enviando atualização do IP da INTERNET!"
    :log info [ ut [/tool dns-update name=$ddnshost address=[ick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ] ]
    :global ddnslastip $ddnsip


    } else={


    :log info "ChangeIP: IP da INTERNET não mudou."


    }


    }


    # END OF SCRIPT

  10. #10

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    @droptux, sim, funciona sim, estou usando ele nesse momento.

  11. #11

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Amigo, coloca o código dentro das tags!

  12. #12

    Padrão Re: Alguém tem script pra atualizar changeip na RB 750 V.6.13 e 6.27? Por gentileza!

    Pessoal precisei recentemente de acesso externo a um equipamento de um cliente com ips dinâmicos e precisei efetuar alguns ajustes para que o ChangeIp pudesse funcionar da forma que me atendesse.
    Sendo assim usei partes de vários scripts postados no fórum para chegar a este que estou utilizando e funcionando corretamente, este script não é de minha autoria eu só realizei algumas modificações e agradeço desde já quem deu inicio ao script em si.

    /system script
    add name=ChangeIP owner=admin policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="#\
    \_Dynamic DNS Update Script\r\
    \n# Modificado por Marcelo Medeiros, ChangeIP.com\r\
    \n#11042018 Testado em RouterOS 6.41.3\r\
    \n\r\
    \n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\
    \n# EDITE SUAS CONFIGURACOES AQUI ChangeIP.com\r\
    \n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\
    \nip address print file=lista_ips\r\
    \n:global ddnsuser "seu usuario changeip"\r\
    \n:global ddnspass "sua senha"\r\
    \n:global ddnshost "seu hostname.changeip.net"\r\
    \n:global ddnsinterface "Interface EtherX"\r\
    \n:delay 2s\r\r\
    \n:global systemID [/system identity get name]\r\r\
    \n:global RB [/system routerboard get model]\r\r\
    \n:global versionID [/system resource get version]\r\
    \n:global IP [/ip cloud get public-address]\r\r\
    \n:global data [/system clock get date]\r\r\
    \n:global hora [/system clock get time]\r\r\
    \n:global version [/system resource get version]\r\
    \n:global ddnsinterface "Interface EtherX"\r\
    \n:global ddnsip \$IP\r\r\
    \n/tool e-mail send to=seu endereco de [email protected] subject=\\\r\
    \n"\$systemIDdia\$data as \$hora, \$version, \$systemID IP:\$IP"\\\r\
    \nfile="lista_ips.txt" body="Envio automatico dos Ips servidor de \\\r\
    \r\
    \n \$systemID IP:\$IP RB modelo \$RB versao \$versionID realizado\\\r\r\
    \nas \$hora de \$data \$ddnsinterface."\r\
    \n# Change ddnsport to 8245 to bypass proxy.\r\
    \n:local ddnsport 80\r\
    \n\r\
    \n# Do not edit anything below this line. You have been warned.\r\
    \n# Abusive updates to the system will cause firewall blocks.\r\
    \n\r\
    \n# Please be considerate and\r\
    \n# do not let this script run more than once per 3-5 minutes.\r\
    \n\r\
    \n:log info "DDNS: Starting."\r\
    \n\r\
    \n# Initialize checkpoint\r\
    \n:global ddnscheckpoint\r\
    \n:if ([:typeof \$ddnscheckpoint] = "time") do={\r\
    \n\t:log info ("DDNS: Last check was " . ([/system clock get time] - \$d\
    dnscheckpoint))\r\
    \n} else={\r\
    \n\t:log info "DDNS: Cannot determine checkpoint, set now."\r\
    \n\t:global ddnscheckpoint ( [/system clock get time] - 1d )\r\
    \n}\r\
    \n\r\
    \n# Get the current IP\r\
    \n:if ([/system clock get time] - \$ddnscheckpoint > [:totime 180s] || [/s\
    ystem clock get time] - \$ddnscheckpoint < [:totime 0s]) do={\r\
    \n :log info "DDNS: Performing remote IP detection."\r\
    \n /tool fetch address="ip.changeip.com" host="ip.changeip.com" src-pa\
    th=("/\?" . [/int eth get 0 mac-address ]) dst-path="ip.changeip.com.tx\
    t" mode=http port=\$ddnsport\r\
    \n :global ddnscheckpoint [/system clock get time]\r\
    \n} else={\r\
    \n :log info "DDNS: Please be considerate and wait a few seconds longer.\
    "\r\
    \n :break\r\
    \n}\r\
    \n\r\
    \n# Parse the IP address received from fetch script.\r\
    \n\t:global ddnslastip\r\
    \n\t:local html [/file get "ip.changeip.com.txt" contents]\r\
    \n\t:local ddnsip [ick \$html ([:find \$html "<!--IPADDR="] + 11) [:fi\
    nd \$html "-->"] ]\r\
    \n\r\
    \n# Is it a valid IP and is it different than the last one\?\r\
    \n\t:if ([:typeof [:toip \$ddnsip]] = "ip" AND \$ddnsip != \$ddnslastip \
    ) do={\r\
    \n\t\t:log info "DDNS: Sending UPDATE with \$ddnsip"\r\
    \n\t\t:log info [/tool dns-update name=\$ddnshost address=\$ddnsip key-nam\
    e=\$ddnsuser key=\$ddnspass ]\r\
    \n\t\t:global ddnslastip \$ddnsip\r\
    \n\t} else={\r\
    \n\t\t:log info "DDNS: No update required."\r\
    \n\t}\r\
    \n}\r\
    \n"
    /system scheduler
    add interval=6h name=ChangeIP on-event="/ system script run ChangeIP" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=apr/04/2018 start-time=08:00:00