Set it as the homepageBookmark this site

简体中文 繁體中文 English 日本語 Deutsch 한국 사람 بالعربية TÜRKÇE português คนไทย

 Retrieve your password
 Sign up now
img_loading
Intelligent detection

QQ login

Just one step, get started quickly

Search
Ad delivery contact QQ68610888Ad delivery contact QQ68610888
glinet
View: 521|Reply: 3

[Router OS] changeip updates the DDNS code and the two-line policy

[Copy link]
Posted on 2025-1-21 18:29 | Show all floors |Reading mode
  1. #5qq: 20822 This DDNS script updates the line to PPPOE-OUT1 by default, and updates PPPOE-OUT2 if PPPOE-OUT1 is disconnected
  2. :do {
  3. :local ether
  4. #DDNS帐号
  5. :local user  ludy20822-5qq
  6. #DDNS密码
  7. :local pass  ludy20822-5qq
  8. #DDNS域名
  9. :local host  "20822.tw.ocry.com"
  10. #以下不需要修改
  11. :local status [/interface pppoe-client get [/interface pppoe-client find name="pppoe-out1"] running];
  12. :if ($status=true) do={
  13. :set ether "pppoe-out1"};
  14. :if ($status=false) do={
  15. :set ether "pppoe-out2"};
  16. :local oldip [:resolve $host]
  17. :delay 5s
  18. :local newip [ /ip address get [/ip address find interface=$ether ] address ]
  19. :set newip [:pick $newip 0 [:find $newip "/"]]
  20. :if ($oldip != $newip) do={
  21. /tool fetch url=("https://nic.changeip.com/nic/update\?u=$user&p=$pass&hostname=$host&ip=$newip") keep-result=no
  22. :log error ("\BE\C9\B5\C4IP\B5\D8\D6\B7\A3\BA: ".$oldip)
  23. :log error ("\D0\C2\B5\C4IP\B5\D8\D6\B7\A3\BA: ".$newip)}
  24. }

Copy the code


Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Landlord| Published on 2025-2-2 00:05 | Show all floors
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Published on 2025-2-3 23:24 | Show all floors
My two-line strategy:
Run the DDNS code update separately after each ppoeout dialing success,
The dual WAN has 2 IPs, which need to be offloaded, otherwise it will not be connected, for example, the wireguard connection, routeros does not specify the WAN port by default.
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
Landlord| Published on 2025-3-14 19:10 | Show all floors
You can set a default route.
Only talk about technology, don't talk about politics! (Click for details) | Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.
You'll need to be logged in to reply to posts login | Sign up now

This version of the points rules

Shut down

Welcome to the Enshan Wireless Forum

Only talk about technology, don't talk about politics! Don't spread rumors! For you and for others.
Only talk about technology, don't talk about politics! (Click for details) Remember not to spread rumors at will, just live your life in peace, for your own good and for the good of everyone. Enshan Wireless Forum welcomes your visit, please respect each other, friendly exchanges, it is recommended to keep a normal mind to look at the comments of netizens, do not overreact.

View »

If in doubt, add an administrator QQ86788181|Mobile version|Little dark house|Archiver|Enshan Wireless Forum (Changzhou Enshan Computer Development Co., Ltd. All rights reserved) ( Su ICP No. 05084872 )

GMT+8, 2025-5-21 15:48

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com

快速回复 返回顶部 返回列表