Hello, I have a dynamic IP setup, No-ip, and want to use my hostname under the “new radius server” section, in winbox… my routerboard… but it only accepts IP’s, but I don’t have a static IP
so how can I fix this one?
This thread really didn’t help much tho..
http://forum.mikrotik.com/t/feture-request-hostname-compatibility-instead-of-ip-address/30152/1
Use a script that looksup hostname every xx minutes and puts the IP address in the radius server field. There are plenty of examples for looking at around here.
I’ve found a script for No-Ip but ive got no idea what and where its going to put or change the updated IP
http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_No-IP_DNS
That runs the dynamic ip service only. You need to script lookup hostname and put in radius field also. Two different things.
That runs the dynamic ip service only. You need to script lookup hostname and put in radius field also. Two different things.
I’ve got noooo idea how its works mate
woow, I don’t think this scripts is going to work for me, why can I just type my no-ip-hostname is the IP field …lol, that would solve all my problems, and then the hostname wil get resolved by a DNS server
Mikrotik doesn’t work that way. You have to use a host lookup script.
Try searching the forums. This isn’t that uncommon a question.
For example, this will get you started:
http://forum.mikrotik.com/t/best-vpn-to-use-using-dynamic-dns/31582/1
http://nok5150.wordpress.com/2011/02/10/update-ip-script-mikrotik/
I’m going to try that one out.. ![]()
I hope it works, because I don’t understand everything in the scrips. its all like a bunch of random code to me.
Copy and paste this into terminal, making sure to change the “myradiusserver.example.tld” and replacing it with your own radius server DNS name.
/system scheduler
add disabled=no interval=30m name=update-radius-server on-event=":local radiusname \"myradiusserver.example.tld\"\r\
\n:local newradiusip [:resolve \$\"radiusname\"]\r\
\n:local currentradiusip [/radius get 0 address]\r\
\n:if (\$\"currentradiusip\" != \$\"newradiusip\") do={ /radius set 0 address=\$\"newradiusip\"}" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-time=startup
For ease of reading, if you’re doing it through winbox → system → scheduler the code is:
:local radiusname "myradiusserver.example.tld"
:local newradiusip [:resolve $"radiusname"]
:local currentradiusip [/radius get 0 address]
:if ($"currentradiusip" != $"newradiusip") do={ /radius set 0 address=$"newradiusip"}
And the script is set to run on startup then repeat every 30 minutes.
Hope this helps! ![]()
Hello I tried this script and its not updating…
{
:local resolvedIP [:resolve “server.example.com”];
:local radiusID [/radius find comment=“myRad”];
:local currentIP [/radius get $radiusID address];
:if ($resolvedIP != $currentIP) do={
/radius set $radiusID address=$resolvedIP;
/log info “radius ip updated”;
}
}
help…