Community discussions

MikroTik App
 
reza.mnp
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 90
Joined: Mon Jun 11, 2007 9:44 am
Location: ilam - iran
Contact:

What's the Problem? remove to-address ip-binding

Wed Mar 10, 2010 1:23 pm

[admin@iu] > ip hotspot ip-binding set to-address="" numbers=1
invalid value for argument to-address
i want remove the to-address in the ip-binding hotspot
thanx
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7198
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: What's the Problem? remove to-address ip-binding

Wed Mar 10, 2010 2:20 pm

empty string is invalid IP address. You have to use 'unset' command
 
reza.mnp
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 90
Joined: Mon Jun 11, 2007 9:44 am
Location: ilam - iran
Contact:

Re: What's the Problem? remove to-address ip-binding

Thu Mar 11, 2010 7:04 pm

What form the command write?
Please check an example.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: What's the Problem? remove to-address ip-binding

Fri Mar 12, 2010 5:18 pm

something like
/ip hotspot ip-binding unset to-address numbers=1
 
reza.mnp
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 90
Joined: Mon Jun 11, 2007 9:44 am
Location: ilam - iran
Contact:

Re: What's the Problem? remove to-address ip-binding

Fri Mar 12, 2010 9:05 pm

[admin@u] > /ip hotspot ip-binding unset to-address numbers=1
bad command name unset (line 1 column 24)
MT version 4.5
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: What's the Problem? remove to-address ip-binding

Sat Mar 13, 2010 6:56 pm

oh, I see... this one works:
/ip hotspot ip-binding set to-address=0.0.0.0 numbers=1
 
reza.mnp
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 90
Joined: Mon Jun 11, 2007 9:44 am
Location: ilam - iran
Contact:

Re: What's the Problem? remove to-address ip-binding

Sat Mar 13, 2010 9:15 pm

thanx alot
:for f from 0 to 10 do={
/ip hotspot ip-binding set to-address=0.0.0.0 numbers=$f
}
[admin@u] > system script run ip-binding-to-address 
interrupted
           no such item
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: What's the Problem? remove to-address ip-binding

Sat Mar 13, 2010 9:55 pm

You don't use item numbers like that in loops, it is possible in some situations but isn't advisable. Generally you want to use 'find' to identify items to perform actions on and then perform the action on that reference.

For example, if you want to remove all IP bindings, use the below:
:foreach binding in=[/ip hotspot ip-binding find] do={
    /ip hotspot ip-binding set $binding to-address=0.0.0.0 
}
Generally, referring to item numbers in scripts is a bad idea.
 
reza.mnp
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 90
Joined: Mon Jun 11, 2007 9:44 am
Location: ilam - iran
Contact:

Re: What's the Problem? remove to-address ip-binding

Sun Mar 14, 2010 8:56 am

Thank you very much.