Community discussions

MikroTik App
 
qbek
just joined
Topic Author
Posts: 20
Joined: Mon Sep 21, 2015 3:34 pm
Location: Poland
Contact:

Update no-ip script for 6.32.2

Mon Sep 21, 2015 7:20 pm

Hi,
I'm looking for no-ip update script for RB951Ui-2HnD with 6.32.2.
This what I have stopped working, I have tried some scripts but no results :(
Thanks.
 
TikUser
newbie
Posts: 48
Joined: Thu Jul 04, 2013 2:40 pm
Location: EU

Re: Update no-ip script for 6.32.2

Fri Sep 25, 2015 1:04 pm

 
qbek
just joined
Topic Author
Posts: 20
Joined: Mon Sep 21, 2015 3:34 pm
Location: Poland
Contact:

Re: Update no-ip script for 6.32.2

Sun Sep 27, 2015 7:00 pm

From the link above script don't work.
I have found another which works:
policy ftp read write test

# No-IP automatic Dynamic DNS update
#--------------- Change Values in this section to match your setup ------------------

# No-IP User account info
:local noipuser "xxx"
:local noippass "xxx"

# Set the hostname or label of network to be updated.
# Hostnames with spaces are unsupported. Replace the value in the quotations below with your host names.
# To specify multiple hosts, separate them with commas.

:local noiphost "xxx.no-ip.com"

# Change to the name of interface that gets the dynamic IP address

:local inetinterface "pppoe-out1_VDSL"

#------------------------------------------------------------------------------------

# No more changes need

:global previousIP

:if ([/interface get $inetinterface value-name=running]) do={

# Get the current IP on the interface

:local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address]


# Strip the net mask off the IP address

:for i from=( [:len $currentIP] - 1) to=0 do={

:if ( [:pick $currentIP $i] = "/") do={

:set currentIP [:pick $currentIP 0 $i]

}

}



:if ([:typeof $previousIP] = "nil") do={:set previousIP ""}

:log info "No-IP: Current IP $currentIP is not equal to previous IP, update needed"

:set previousIP $currentIP



# The update URL. Note the "\3F" is hex for question mark (?). Required since ? is a special character in commands.

:local url "http://dynupdate.no-ip.com/nic/update\3Fmyip=$currentIP"

:local noiphostarray

:set noiphostarray [:toarray $noiphost]

:foreach host in=$noiphostarray do={

:log info "No-IP: Sending update for $host"

/tool fetch url=($url . "&hostname=$host") user=$noipuser password=$noippass mode=http dst-path=("no-

ip_ddns_update-" . $host . ".txt")

:log info "No-IP: Host $host updated on No-IP with IP $currentIP"

}

} else={

:log info "No-IP: Previous IP $previousIP is equal to current IP, no update needed"

}

} else={

:log info "No-IP: $inetinterface is not currently running, so therefore will not update."

}


From log:
15:20:45 script,info No-IP: Current IP 83.31.xxx.xxx is not equal to previous IP, update needed
15:20:45 script,info No-IP: Sending update for xxx.no-ip.com
15:50:45 script,info No-IP: Current IP 83.31.xxx.xxx is not equal to previous IP, update needed
15:50:45 script,info No-IP: Sending update for xxx.no-ip.com
16:20:45 script,info No-IP: Current IP 83.31.xxx.xxx is not equal to previous IP, update needed
16:20:45 script,info No-IP: Sending update for xxx.no-ip.com
16:50:45 script,info No-IP: Current IP 83.31.xxx.xxx is not equal to previous IP, update needed
16:50:45 script,info No-IP: Sending update for xxx.no-ip.com
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: terminating...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: disconnected
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: initializing...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: connecting...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: terminating... - failed to authenticate ourselves to peer
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: disconnected
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: initializing...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: connecting...
16:50:57 pppoe,ppp,info pppoe-out1_VDSL: authenticated
16:50:57 pppoe,ppp,info pppoe-out1_VDSL: connected
16:50:57 system,info item added
16:50:57 system,info item added
17:20:45 script,info No-IP: Current IP 83.28.xxx.xx is not equal to previous IP, update needed
17:20:45 script,info No-IP: Sending update for xxx.no-ip.com
17:50:45 script,info No-IP: Current IP 83.28.xxx.xx is not equal to previous IP, update needed
17:50:45 script,info No-IP: Sending update for xxx.no-ip.com
18:20:45 script,info No-IP: Current IP 83.28.xxx.xx is not equal to previous IP, update needed
18:20:45 script,info No-IP: Sending update for xxx.no-ip.com

After that I must login on no-ip.com, go to Hosts / Redirects and hit "update host" button because IP don't update with new IP 83.28.xxx.xx when script run. And after that it works.

I have ISP modem in bridge mode which automatically reconnect connection after 24h
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: terminating...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: disconnected
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: initializing...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: connecting...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: terminating... - failed to authenticate ourselves to peer
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: disconnected
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: initializing...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: connecting...
16:50:57 pppoe,ppp,info pppoe-out1_VDSL: authenticated
16:50:57 pppoe,ppp,info pppoe-out1_VDSL: connected

How to start/setup no-ip script after my connection get status: pppoe-out1_VDSL: connected?
Is that any way to get script works properly (no hit "update host").
Thanks
 
TikUser
newbie
Posts: 48
Joined: Thu Jul 04, 2013 2:40 pm
Location: EU

Re: Update no-ip script for 6.32.2

Tue Sep 29, 2015 9:07 pm

I have tested the script from user rextended (Created by user ovdeathiam and modified by user rextended.) on ROS v6.32.2 and it works just fine. Maybe something in your ROS configuration blocks the script from working properly.
If the ip address doesn't update, then the script you found also doesn't work for your configuration. The No-Ip service should update the ip address automatically after receiving the new ip address.
Or, you have found a bug in their system. :D
 
deanMKD1
Member
Member
Posts: 366
Joined: Fri Dec 12, 2014 12:06 am
Location: Macedonia
Contact:

Re: Update no-ip script for 6.32.2

Tue Sep 29, 2015 11:16 pm

From the link above script don't work.
I have found another which works:
policy ftp read write test

# No-IP automatic Dynamic DNS update
#--------------- Change Values in this section to match your setup ------------------

# No-IP User account info
:local noipuser "xxx"
:local noippass "xxx"

# Set the hostname or label of network to be updated.
# Hostnames with spaces are unsupported. Replace the value in the quotations below with your host names.
# To specify multiple hosts, separate them with commas.

:local noiphost "xxx.no-ip.com"

# Change to the name of interface that gets the dynamic IP address

:local inetinterface "pppoe-out1_VDSL"

#------------------------------------------------------------------------------------

# No more changes need

:global previousIP

:if ([/interface get $inetinterface value-name=running]) do={

# Get the current IP on the interface

:local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address]


# Strip the net mask off the IP address

:for i from=( [:len $currentIP] - 1) to=0 do={

:if ( [:pick $currentIP $i] = "/") do={

:set currentIP [:pick $currentIP 0 $i]

}

}



:if ([:typeof $previousIP] = "nil") do={:set previousIP ""}

:log info "No-IP: Current IP $currentIP is not equal to previous IP, update needed"

:set previousIP $currentIP



# The update URL. Note the "\3F" is hex for question mark (?). Required since ? is a special character in commands.

:local url "http://dynupdate.no-ip.com/nic/update\3Fmyip=$currentIP"

:local noiphostarray

:set noiphostarray [:toarray $noiphost]

:foreach host in=$noiphostarray do={

:log info "No-IP: Sending update for $host"

/tool fetch url=($url . "&hostname=$host") user=$noipuser password=$noippass mode=http dst-path=("no-

ip_ddns_update-" . $host . ".txt")

:log info "No-IP: Host $host updated on No-IP with IP $currentIP"

}

} else={

:log info "No-IP: Previous IP $previousIP is equal to current IP, no update needed"

}

} else={

:log info "No-IP: $inetinterface is not currently running, so therefore will not update."

}


From log:
15:20:45 script,info No-IP: Current IP 83.31.xxx.xxx is not equal to previous IP, update needed
15:20:45 script,info No-IP: Sending update for xxx.no-ip.com
15:50:45 script,info No-IP: Current IP 83.31.xxx.xxx is not equal to previous IP, update needed
15:50:45 script,info No-IP: Sending update for xxx.no-ip.com
16:20:45 script,info No-IP: Current IP 83.31.xxx.xxx is not equal to previous IP, update needed
16:20:45 script,info No-IP: Sending update for xxx.no-ip.com
16:50:45 script,info No-IP: Current IP 83.31.xxx.xxx is not equal to previous IP, update needed
16:50:45 script,info No-IP: Sending update for xxx.no-ip.com
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: terminating...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: disconnected
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: initializing...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: connecting...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: terminating... - failed to authenticate ourselves to peer
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: disconnected
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: initializing...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: connecting...
16:50:57 pppoe,ppp,info pppoe-out1_VDSL: authenticated
16:50:57 pppoe,ppp,info pppoe-out1_VDSL: connected
16:50:57 system,info item added
16:50:57 system,info item added
17:20:45 script,info No-IP: Current IP 83.28.xxx.xx is not equal to previous IP, update needed
17:20:45 script,info No-IP: Sending update for xxx.no-ip.com
17:50:45 script,info No-IP: Current IP 83.28.xxx.xx is not equal to previous IP, update needed
17:50:45 script,info No-IP: Sending update for xxx.no-ip.com
18:20:45 script,info No-IP: Current IP 83.28.xxx.xx is not equal to previous IP, update needed
18:20:45 script,info No-IP: Sending update for xxx.no-ip.com

After that I must login on no-ip.com, go to Hosts / Redirects and hit "update host" button because IP don't update with new IP 83.28.xxx.xx when script run. And after that it works.

I have ISP modem in bridge mode which automatically reconnect connection after 24h
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: terminating...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: disconnected
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: initializing...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: connecting...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: terminating... - failed to authenticate ourselves to peer
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: disconnected
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: initializing...
16:50:55 pppoe,ppp,info pppoe-out1_VDSL: connecting...
16:50:57 pppoe,ppp,info pppoe-out1_VDSL: authenticated
16:50:57 pppoe,ppp,info pppoe-out1_VDSL: connected

How to start/setup no-ip script after my connection get status: pppoe-out1_VDSL: connected?
Is that any way to get script works properly (no hit "update host").
Thanks
Set scheduler and set to run the script for 30-60 mins. :)
 
qbek
just joined
Topic Author
Posts: 20
Joined: Mon Sep 21, 2015 3:34 pm
Location: Poland
Contact:

Re: Update no-ip script for 6.32.2

Wed Sep 30, 2015 10:00 am

Ok, I have found out where is the problem in script ip update.
I will start from the beginning.I got many TCP/UDP connections in log so I used firewall to block certain countries. I use this site http://www.mikrotikconfig.com/firewall/ for generating IP list to block certain countries. First was China, Germany, Sweden.

2 ;;; ban
chain=input action=drop protocol=tcp src-address-list=CountryIPBlocks
log=no log-prefix="___"

3 X ;;; ban
chain=input action=drop protocol=udp src-address-list=CountryIPBlocks
log=yes log-prefix="___"

So, I start to disable one rule after one and in middle time run script. When I disable UDP rule, script start working.
It looks like some ip in country list are used to no-ip address update? it's really strange...I don't even know that this will block script.

I also set interval time to 30min but this isn't good solution, because when modem disconnect and connect I must wait 30min to update ip, but I need to noip works nonstop.
I will ask again how to start/setup no-ip script after my connection get status: pppoe-out1_VDSL: connected when run script no-ip.

Who is online

Users browsing this forum: No registered users and 12 guests