Community discussions

MikroTik App
 
nonac
newbie
Topic Author
Posts: 27
Joined: Tue Sep 02, 2014 7:36 pm

check ip and renew

Thu Sep 11, 2014 4:08 pm

hello guys,

i want to check gateway ip of dhcp-client if its 1.1.1.1
then if its not 1.1.1.1 (gateway) it will renew until such time it can obtain 1.1.1.1 then it will stop renewing ip..


thanks my first time to post! hope anyone can help me
 
nonac
newbie
Topic Author
Posts: 27
Joined: Tue Sep 02, 2014 7:36 pm

Re: check ip and renew

Sat Sep 13, 2014 3:22 am

anyone? :?
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: check ip and renew

Sat Sep 13, 2014 11:47 pm

there are some ways to do it

ros code

while condition=([ip dhcp-client get value-name=gateway 0]!= 1.1.1.1) do={
delay 2s;
ip dhcp-client disable 0;
delay 5s;
ip dhcp-client enable 0;
delay 3s;}}
or

ros code

local ip [ip dhcp-client get value-name=gateway 0]
if ($ip!= 1.1.1.1) do={
ip dhcp-client release 0;
ip dhcp-client renew 0;
}
the latest script you need to execute by scheduler every time.
 
nonac
newbie
Topic Author
Posts: 27
Joined: Tue Sep 02, 2014 7:36 pm

Re: check ip and renew

Sun Sep 14, 2014 2:19 am

thank you sir will try!

can i add lists of ip address example , 1.1.1.1 , 2.2.2.2 , 3.3.3.3 , 4.4.4.4 as basis?
instead of 1 ip like 1.1.1.1 i would like to create lists

Who is online

Users browsing this forum: Bing [Bot] and 58 guests