TypechoJoeTheme

Dcr163的博客

统计

ROS设置changeip动态域名脚本

2015-10-18
/
0 评论
/
906 阅读
/
正在检测是否收录...
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. William Tardent
    2024-02-27
  2. Maryann Hamer
    2024-02-27
  3. Sanora Pantano
    2024-02-24
  4. aa
    2024-02-21
  5. Kassie Baum
    2024-01-28

标签云