Community discussions

MikroTik App
 
User avatar
Harunaga
newbie
Topic Author
Posts: 29
Joined: Tue May 04, 2010 11:43 am
Location: Chelyabinsk, Russia

How to remove a static route using API?

Wed May 05, 2010 6:26 pm

How to remove a static route using API?

Example:
ip route print where dst-address =192.168.153.2/32
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 1   S  192.168.153.2/32                     wlan2              1
API:
/ip/route/print
?dst-address=192.168.153.2/32

stReturnSentence.szSentence[0] = !re
stReturnSentence.szSentence[1] = =dst-address=192.168.153.2/32
stReturnSentence.szSentence[2] = =gateway=wlan2
stReturnSentence.szSentence[3] = =gateway-status=wlan2 unreachable
stReturnSentence.szSentence[4] = =distance=1
stReturnSentence.szSentence[5] = =active=false
stReturnSentence.szSentence[6] = =static=true
stReturnSentence.szSentence[0] = !done
Sentence iLength = 7
Sentence iReturnValue = 0
"id" not present, "find" not work.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: How to remove a static route using API?

Fri May 07, 2010 6:24 pm

what version do you use? for me v4.2 and v4.6 works fine
 
User avatar
Harunaga
newbie
Topic Author
Posts: 29
Joined: Tue May 04, 2010 11:43 am
Location: Chelyabinsk, Russia

Re: How to remove a static route using API?

Fri May 07, 2010 8:03 pm

what version do you use? for me v4.2 and v4.6 works fine
I use 5.0beta2. Please show an example of removing the route using an API.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8709
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: How to remove a static route using API?

Mon May 10, 2010 1:52 pm

I mean, in v4 '.id' field is present. AFAIR, somebody have already complained about missing API parameters in v5.0beta - try v4
 
User avatar
Harunaga
newbie
Topic Author
Posts: 29
Joined: Tue May 04, 2010 11:43 am
Location: Chelyabinsk, Russia

Re: How to remove a static route using API?

Wed May 19, 2010 6:27 pm

In v4.9 field is not present :(

Who is online

Users browsing this forum: Bing [Bot], KpuCko, Valerio5000 and 112 guests