Jump to content
  • 0

Mikrotik и DynDNS


Joro_Blg

Question

Recommended Posts

  • 0
kokaracha

Със скрипт що не опиташ.

Use since

OpenBSD 3.x

FreeBSD 4.x

Centos 5.x Debian 3.x Ubuntu 7.x

Аз съм фен на OpenWRT.

 

Горчивината от лошото качество остава дълго след като е преминало удоволствието от ниската цена.

_____________________________

___|____|____|____|____|____|__

_|____|____|____|____|____|____

___|____|_ Удряй _|____|____|__

_|____|___ главата ___|____|____

___|____|_ си тук!! |____|____|__

_|____|____|____|____|____|____

___|____|____|____|____|____|__

Link to post
Share on other sites
  • 0
Mupo neTkoB

Теория - това е когато знаете всичко, но нищо не работи

Практика - това е когато всичко работи, но не знаете защо

При нас съчетаваме теорията с практиката - НИЩО не работи и нямаме понятие защо!!!

Link to post
Share on other sites
  • 0
  • Administrator

редактира ли 

:global ddnsuser "DYNDNSUSER"
:global ddnspass "DYNDNSPASS"
:global ddnshost "DYNDNSHOST"[/code]

Харесай поста ^^^
acer.gif htc.gifsigpic4024_2.gif

Форумът е за взаимопомощ а не за свършване на чужда работа


ɹɐǝɥ uɐɔ noʎ ǝɹoɯ ǝɥʇ 'ǝɯoɔǝq noʎ ɹǝʇǝınb ǝɥʇ

Link to post
Share on other sites
  • 0

редактира ли

:global ddnsuser "DYNDNSUSER"

:global ddnspass "DYNDNSPASS"

:global ddnshost "DYNDNSHOST"

Редактирах го и ми изписва някаква грешки в червено.Пробвах и с кавичките,и без тях.А хоста с http:// ли трябва да се напише?

Link to post
Share on other sites
  • 0
Mupo neTkoB

мисля че не, somePCname.goddns.com примерно

Теория - това е когато знаете всичко, но нищо не работи

Практика - това е когато всичко работи, но не знаете защо

При нас съчетаваме теорията с практиката - НИЩО не работи и нямаме понятие защо!!!

Link to post
Share on other sites
  • 0

# Set needed variables

:local username "юзера"

:local password "паролата"

:local hostname "хоста"

:global dyndnsForce

:global previousIP

# print some debug info

:log info ("dyndns-update: username = $username")

:log info ("dyndns-update: password = $password")

:log info ("dyndns-update: hostname = $hostname")

:log info ("dyndns-update: previousIP = $previousIP")

# get the current IP address from the internet (in case of double-nat)

/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"

:local result [/file get dyndns.checkip.html contents]

# parse the current IP result

:local resultLen [:len $result]

:local startLoc [:find $result ": " -1]

:set startLoc ($startLoc + 2)

:local endLoc [:find $result "</body>" -1]

:local currentIP [:pick $result $startLoc $endLoc]

:log info "dyndns-update: currentIP = $currentIP"

# Determine if dyndns update is needed

# more dyndns updater request details available at http://www.dyndns.com/developers/specs/syntax.html

:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={

    :set dyndnsForce false

    :set previousIP $currentIP

    /tool fetch user=$username password=$password mode=http address="members.dyndns.org" src-path="/nic/update?hostname=$hostname&myip=$currentIP" dst-path="/dyndns.txt"

    :local result [/file get dyndns.txt contents]

    :log info ("dyndns-update: Dyndns update needed")

    :log info ("dyndns-update: Dyndns Update Result: ".$result)

    :put ("Dyndns Update Result: ".$result)

} else={

    :log info ("dyndns-update: No dyndns update needed")

}

този работи аз съм с него

копи->пасте - само редактираш 3те реда отгоре и работи

и това в скриптс -> system script run dynDNS_скрипта

успех

Link to post
Share on other sites
  • 0

Какво означава това ? local theinterface "device to renove IP" или по точно какво трябва да се напише тук. Нещо нищо не мога да подкарам чета тук http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_dynDNS ползвам скрип за версия 4.17 пробвах и 2-та ама нищо не се получава може ли някой малко помощ ?

Edited by Momo
Link to post
Share on other sites
  • 0

### DDNS No-Ip script based on DIPU - Dynamic IP Updater V1.5 ###

:log info "DIPU: Starting"

#

:local currentIP

### Get the default route

:foreach routeId in=[/ip route find dst-address=0.0.0.0/0 active=yes ] do={

:local routeGateway [/ip route get $routeId gateway]

:local interfaceID [/ip address find network=$routeGateway ]

:set currentIP [/ip address get $interfaceID address]

}

#

###

:if ($currentIP != "") do={

#

### Define DDNS credentials ###

:local userDDNS "-----------"

:local passDDNS "------------"

### hostDDNS is the host or group name

:local hostDDNS "grouporhostname"

### single host is the same as above unless updating a group where it must be any host in the group

:local singlehost "-----------------"

:local providerAddress "dynupdate.no-ip.com"

:local emailAddressToNotify "notify@somedomain.com"

#

### Get current IP ###

#:local currentIP [/ip address get [/ip address find interface="$ddnsinterface"] address]

:set currentIP [:pick $currentIP 0 [:find $currentIP "/"]]

:log info "DIPU: Current gateway IP is $currentIP"

#

### Define update URLs ###

:local ddnsURL ("/nic/update\?hostname=$hostDDNS&amp;myip=$currentIP")

#

### get the current IP address from the internet (in case of double-nat)

:log info "DIPU: Resolving Domain ip"

:local lastIP [:resolve $singlehost]

:log info "DIPU: Resolved Domain IP to $lastIP"

#

### Compare current IP with last, if changes detected perform update ###

:if ( $currentIP != $lastIP ) do={

:log info "DIPU: WAN IP change detected from $lastIP to $currentIP"

#

### Perform DDNS update ###

:log info "DIPU: DDNS built url: $ddnsURL"

:log info "DIPU: DDNS update being attempted"

/tool fetch address=$providerAddress dst-path=fetch-out.txt src-path=$ddnsURL mode=http user=$userDDNS password=$passDDNS

:delay 2

:local ddnsOUT [/file get fetch-out.txt contents]

/tool e-mail send subject="No-Ip Address Changed from $lastIP to $currentIP" to=$emailAddressToNotify body="DNS update result was '$ddnsOUT'"

:log info "DIPU: DDNS update result was '$ddnsOUT'"

#

###

:local resultString "'$ddnsOUT'"

### Email/Stop scheduler depending on the reult from no-ip

:if ([find $resultString "good" -1] != "") do={

/tool e-mail send subject="Success:DNS hostname update successful" to=$emailAddressToNotify body="Ip Address Changed from $lastIP to $currentIP , DNS update result was $resultString"

} else={

:if ([find $resultString "nochg" -1] != "") do={

/tool e-mail send subject="Success:IP address is current, no update performed" to=$emailAddressToNotify body="Ip remains $currentIP, DNS update result was $resultString"

} else={

:if ([find $resultString "nohost" -1] != "") do={

/tool e-mail send subject="Error:Hostname supplied does not exist under specified account" to=$emailAddressToNotify body="Scheduler stopped, DNS update result was $resultString"

:local scheduleId [/system scheduler find "DDNS"]

/system scheduler disable $scheduleId

} else={

:if ([find $resultString "badauth" -1] != "") do={

/tool e-mail send subject="Error:Invalid username password combination" to=$emailAddressToNotify body="Scheduler stopped, DNS update result was $resultString"

:local scheduleId [/system scheduler find "DDNS"]

/system scheduler disable $scheduleId

} else={

:if ([find $resultString "badagent" -1] != "") do={

/tool e-mail send subject="Error:Client disabled. Client should exit and not perform any more updates without user intervention." to=$emailAddressToNotify body="Scheduler stopped, DNS update result was $resultString"

:local scheduleId [/system scheduler find "DDNS"]

/system scheduler disable $scheduleId

} else={

:if ([find $resultString "donator" -1] != "") do={

/tool e-mail send subject="Error:An update request was sent including a feature that is not available to that particular user such as offline options." to=$emailAddressToNotify body="Scheduler stopped, DNS update result was $resultString"

:local scheduleId [/system scheduler find "DDNS"]

/system scheduler disable $scheduleId

} else={

:if ([find $resultString "abuse" -1] != "") do={

/tool e-mail send subject="Error:Username is blocked due to abuse. Either for not following our update specifications or disabled due to violation of the No-IP terms of service. Our terms of service can be viewed at http://www.no-ip.com/legal/tos. Client should stop sending updates." to=$emailAddressToNotify body="Scheduler stopped, DNS update result was $resultString"

:local scheduleId [/system scheduler find "DDNS"]

/system scheduler disable $scheduleId

} else={

:if ([find $resultString "911" -1] != "") do={

/tool e-mail send subject="Error:A fatal error on our side such as a database outage. Retry the update no sooner 30 minutes." to=$emailAddressToNotify body="Scheduler stopped, DNS update result was $resultString"

:local scheduleId [/system scheduler find "DDNS"]

/system scheduler disable $scheduleId

}

}

}

}

}

}

}

}

#

###

:log info "DIPU: Update complete"

#

} else={

:log info "DIPU: No update required"

}

}

### End of script ###

това работи при мен ,дано съм помогнал

Никога не се страхувай да правиш това, което не умееш. Помни, че Ноевият ковчег е направен от любители. Професионалистите са построили "Титаник"

Link to post
Share on other sites
  • 0

да ама това е за no-ip а аз търся за dyndns

И аз дълго време се опитвах да подкарам скриптовете на Жоро и от Викито на моя МК-333 версия 3.24 с DynDNS фрее акаунт, но не успях.В момента съм на changeIP.com със следният скрипт от Викито.

dyndns for changeIp.com.txt

Edited by plamenVd

Учи се от грешките на другите. Няма да живееш толкова дълго, че да ги направиш сам всичките.

Link to post
Share on other sites
  • 0

И аз дълго време се опитвах да подкарам скриптовете на Жоро и от Викито на моя МК-333 версия 3.24 с DynDNS фрее акаунт, но не успях.В момента съм на changeIP.com със следният скрипт от Викито.

Да ама това с changeIP.com е платено. Търся нещо безплатно :)

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.