ROS DDNS脚本
:local INTERFACE “pppoe-out1”
:local DDNSUSER “332719***@qq.com”
:local DDNSPASS “****”
:local DDNSHOST “****.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
#更新VPN地址
/ppp profile set VPN_Profile local-address=$DDNSIP
:global DDNSLASTIP $DDNSIP
}
}
}
最活跃的读者