منتديات الرائد
اهلا وسهلا بكم في منتديات الرائد * تسجيلك يشرفنا.
منتديات الرائد
اهلا وسهلا بكم في منتديات الرائد * تسجيلك يشرفنا.
منتديات الرائد
هل تريد التفاعل مع هذه المساهمة؟ كل ما عليك هو إنشاء حساب جديد ببضع خطوات أو تسجيل الدخول للمتابعة.



 
الرئيسيةأحدث الصورالتسجيلدخول

 

 اسكربت لتحديث الـ ip في خدمة opendns

اذهب الى الأسفل 
كاتب الموضوعرسالة
المدير العام

المدير العام


الجنس : ذكر

عدد المساهمات : 540
تاريخ التسجيل : 13/10/2009
العمر : 50

اسكربت لتحديث الـ ip في خدمة opendns Empty
مُساهمةموضوع: اسكربت لتحديث الـ ip في خدمة opendns   اسكربت لتحديث الـ ip في خدمة opendns I_icon_minitimeالخميس مارس 04, 2010 11:07 pm

[b]في البداية عليك بكتابة اسم Label للنتورك بتاعتك ودي بتكون امام [/b]

[b]الاي بي الخاص بيك في موقع opendns.com[/b]
[b]مثلا نخليها Home[/b]
[b]وايضا علينا تفعيل ميزة Enable Dynamic Ip Update[/b]
[b]من قائمة Advanced setting[/b]
[b]وبعد كده[/b]

[b]نقوم بالدخول هنا https://www.dnsomatic.com/account/[/b]
[b]وكتابة بيانات الدخول تبع اشتراكك في خدمة opendns

وبعد تسجيل الدخول قم بالضغط علي add a service
واختار opendns من القائمة
[/b]
[b]ونحدد ال Label الي احنا سبق وعملناها[/b]
[b]وتاني خطوة هتضيف هذا الاسكربت في ال New Terminal
[/b]
كود:
/system script
add name=dynamic-dns-script policy=\
ftp,reboot,read,write,policy,test,winbox,p assword,sniff,sensitive source="\
# User account info of DNSoMatic\r\
\n:global maticuser \"user\"\r\
\n:global maticpass \"password\"\r\
\n:global matichost \"gregsowell-sitea.dyndns.org\"\r\
\n# No more changes need\r\
\n\r\
\n:global previousIP\r\
\n\r\
\n# Print values for debug\r\
\n:log info \"DNSoMatic: Updating dynamic IP on DNS for host \$matichost\"\
\r\
\n:log info \"DNSoMatic: User \$maticuser y Pass \$maticpass\"\r\
\n:log info \"DNSoMatic: Last IP \$previousIP\"\r\
\n\r\
\n# get the current IP address from the internet (in case of double-nat)\r\
\n/tool fetch mode=http address=\"checkip.dyndns.org\" src-path=\"/\" dst-\
path=\"/dyndns.checkip.html\"\r\
\n:local result [/file get dyndns.checkip.html contents]\r\
\n\r\
\n# parse the current IP result\r\
\n:local resultLen [:len \$result]\r\
\n:local startLoc [:find \$result \": \" -1]\r\
\n:set startLoc (\$startLoc + 2)\r\
\n:local endLoc [:find \$result \"\" -1]\r\
\n:global currentIP [:pick \$result \$startLoc \$endLoc]\r\
\n:log info \"DNSoMatic: IP actual \$currentIP\"\r\
\n\r\
\n# Touching the string passed to fetch command on \"src-path\" option\r\
\n:local str \"/nic/update\?hostname=\$matichost&myip=\$curren tIP&wildcard\
=NOCHG&mx=NOCHG&backmx=NOCHG\"\r\
\n\r\
\n:if (\$currentIP != \$previousIP) do={\r\
\n:log info \"DNSoMatic: Update need\"\r\
\n:set previousIP \$currentIP\r\
\n:log info \"DNSoMatic: Sending update \$currentIP\"\r\
\n:log info [ :put [/tool fetch host=MT user=\$maticuser password=\$maticp\
ass mode=http address=\"updates.dnsomatic.com\" src-path=\$str dst-path=\$\
matichost]]\r\
\n:log info \"DNSoMatic: Host \$matichost updated on DNSoMatic with IP \$c\
urrentIP\"\r\
\n} else={\r\
\n:log info \"DNSoMatic: Previous IP \$previousIP and current \$currentIP \
equal, no update need\"\r\
\n}"

/system scheduler
add comment="" disabled=no interval=10m name=dynamic-dns-schedule on-event=dynamic-dns-script \
start-date=jan/01/1970 start-time=00:00:01

مع مراعاة تعديل
user الي اسم المشترك في خدمة opendns
password الي الرقم السري الخاص بك في خدمة opendns
yourhost الي الهوست تبعك واذا لم يكن عندك هوست فعليك بمسح كلمة yourhost وتركها فارغة
وفي النهاية قم بتغيير الدي ان اس الخاص بك
من قائمة ip اختر dns
واكتب
208.67.222.222
208.67.220.220
الرجوع الى أعلى الصفحة اذهب الى الأسفل
https://raed.123.st
 
اسكربت لتحديث الـ ip في خدمة opendns
الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
منتديات الرائد :: الفئة الأولى :: منتدى الانترنت والشبكات NETWORKS :: مايكروتيك سيرفر-
انتقل الى: