Hi
I want to change route distance with API in VB.net .
i use a function that send command to MK like this :
mikrotik.Send(“/ip/route/set”)
mikrotik.Send(“=disabled=no”)
mikrotik.Send(“=.id=*1E” )
mikrotik.Send(“.tag=1”, True)
how can i change route distance like this?
/ip/route/set
=.id=*1E
=distance=100
hi and thanks
i used this commands but this way not work and any distance don’t change. ![]()
/ip/route/set
=.id=*1E
=distance=100
this command don’t change route Distance’s .
could we change distance of route from API?
Works for me with the latest version. Which version you are using? Also try API client from our wiki, it could be bug in your API client.
[admin@dzeltenais_burkaans] /ip route> print
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
0 S 0.0.0.0/0 l2tp-hm 1
/ip/route/set
=.id=*5
=distance=100
[admin@dzeltenais_burkaans] /ip route> print
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
0 S 0.0.0.0/0 l2tp-hm 100
note that this part
=.id=*1E
can and will change. Since you most probably have different .id fields for routes.
my winbox version is 3.30. ![]()
Are you connecting and logging in with the VB script? You received “!done” from the API port?
http://wiki.mikrotik.com/wiki/API
Note it is a different port than Winbox.
ADD: For Mikrotik’s help (Maris in particular) with my MD5 troubleshooting, I promised to start a wiki article on the MD5 part of the login. Just as soon as I get my code key from RIM so my MD5 routine will work in my Blackberry, and I get it logging in.
Hey! MT crew!!! Can I give Maris karma for that? I just looked at the profile. “Just joined”? Really? Might want to update that before I add karma.
Yes I get “!done” from API port bur distance not change .
When you send the command, are you appending a zero character? The router doesn’t do anything unless you send that. With any luck at all, the router will respond with “!done”.
Hi & thx
with this way i can change Disabled(yes/no) fields routes but i don’t know that any zero word send to MK or not .
when i use this way to change distance i get “!done” from MK but distance of routes doesn’t change.