TypechoJoeTheme

Dcr163的博客

统计

ROS设置changeip动态域名脚本

2015-10-18
/
0 评论
/
1,454 阅读
/
正在检测是否收录...
10/18

#0.1
:local INTERFACE "pppoe-out2"
:local DDNSUSER "你的账号"
:local DDNSPASS "你的密码"
:local DDNSHOST "huakang.changeip.net"
:global DDNSLASTIP
 
:if ([ /interface pppoe-client get [/interface pppoe-client find name=$INTERFACE ] running]=true) do={
  :local DDNSIP [ /ip address get [/ip address find dynamic=yes interface="$INTERFACE" ] address ]
  :set DDNSIP [:pick $DDNSIP 0 [:find $DDNSIP "/"] ]

  :if ( [:typeof $DDNSLASTIP]="nothing" ) do={ :global DDNSLASTIP 0.0.0.0/0 }
  :if ( [:typeof $DDNSIP]="nothing" ) do={
   :log info ("DDNS: No ip address present on " . $INTERFACE . ", please check.")
  } else={
   :if ($DDNSIP != $DDNSLASTIP) do={
      :log info "DDNS: Sending Update"
      /tool dns-update name=$DDNSHOST address=$DDNSIP key-name=$DDNSUSER key=$DDNSPASS
      :global DDNSLASTIP $DDNSIP
   }
  }
}


interface 更改为自己的PPPOE-OUT




#1.0
:local INTERFACE "pppoe-out2"
:local DDNSUSER "你的账号"
:local DDNSPASS "你的密码"
:local DDNSHOST "huakang.changeip.net"
:global DDNSLASTIP
 
:if ([ /interface pppoe-client get [/interface pppoe-client find name=$INTERFACE ] running]=true) do={
  :local DDNSIP [ /ip address get [/ip address find dynamic=yes interface="$INTERFACE" ] address ]
  :set DDNSIP [:pick $DDNSIP 0 [:find $DDNSIP "/"] ]

  :if ( [:typeof $DDNSLASTIP]="nothing" ) do={ :global DDNSLASTIP 0.0.0.0/0 }
  :if ( [:typeof $DDNSIP]="nothing" ) do={
   :log info ("DDNS: No ip address present on " . $INTERFACE . ", please check.")
  } else={
   :if ($DDNSIP != $DDNSLASTIP) do={
      :log info "DDNS: Sending Update"
      /tool dns-update name=$DDNSHOST address=$DDNSIP key-name=$DDNSUSER key=$DDNSPASS
      /ppp profile set VPN local-address=$DDNSIP
      :global DDNSLASTIP $DDNSIP
   }
  }
}

朗读
赞(0)
版权属于:

Dcr163的博客

本文链接:

https://www.dcr163.cn/343.html(转载时请注明本文出处及文章链接)

评论 (0)

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

最新回复

  1. https://Sites.google.com/view/vavada-online-casino
    2025-04-12
  2. https://x.com/jeetbuzzcom
    2025-04-07
  3. prozone.cc alternative
    2025-03-19
  4. urgent delivery
    2025-03-16
  5. faster indexing
    2025-03-05

标签云