Community discussions

MikroTik App
 
rueny01
just joined
Topic Author
Posts: 10
Joined: Tue Jul 14, 2009 11:25 am

How to edit and delete added IP address

Sat Jul 18, 2009 2:19 am

Hi Guys,

I'm totally new bie in configuring routerOS, currently I'm using
C# as my way of communicating to the rourterOS, I use the Api example there at the wiki api documentation and it works, my problem is how to edit and delete the added IP Address, this is how I add new IP

router.Send("/ip/address/add");
router.Send("=address=192.168.1.1/24");
router.Send("=network=10.10.10.0");
router.Send("=broadcast=10.10.10.255");
router.Send("=interface=ether1");
router.Send("=disabled=no");
router.Send(".tag=aaa", true);

I tried this statement for removing IP but an error occured

router.Send("/ip/address/remove");
router.Send("=address=192.168.1.1/24");

and for updating something like this

router.Send("/ip/address/set");
router.Send("=address=192.168.1.1/24");

by the way I'm currently using the latest version of the routerOS

Thanks in Advance
 
clarkstyx
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Sun Jun 28, 2009 7:26 pm

Re: How to edit and delete added IP address

Sat Jul 18, 2009 6:41 am

try this one

router.Send("/ip/address/print");

after that it will give you the IP address and the value number on the left most side, usually it is "0"

you can try this

router.Send("/ip/address/remove/0");
 
rueny01
just joined
Topic Author
Posts: 10
Joined: Tue Jul 14, 2009 11:25 am

Re: How to edit and delete added IP address

Sat Jul 18, 2009 10:29 am

Cool, thanks alot
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: How to edit and delete added IP address

Sat Jul 18, 2009 10:30 am

first, you should execute something like
/ip/address/print
=.proplist=.id
?address=what_you_want
to get identifier of the item. then
/ip/address/remove
=.id=your_id
 
juanCasseus
just joined
Posts: 15
Joined: Mon Jul 20, 2009 12:02 am

Re: How to edit and delete added IP address

Mon Jul 20, 2009 12:19 am

hi people!! i need your help!!
i begin in that world and i need to know how i can do to send son command with the php api.

i realy need to disable and enable whith that api

note:sorry, i know my inglish is so bad!!!! but i need your help please
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: How to edit and delete added IP address

Mon Jul 20, 2009 12:31 am

well, looking at 'inglish', I think that it's not a machine translation... so please explain us, what is 'son command' =)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: How to edit and delete added IP address

Mon Jul 20, 2009 12:03 pm

also, when you add some item in return value you receive .id field value of the item you just added, then you can remove the item using that .id value
 
rueny01
just joined
Topic Author
Posts: 10
Joined: Tue Jul 14, 2009 11:25 am

Re: How to edit and delete added IP address

Tue Jul 21, 2009 2:06 am

The remove command is not working.

/ip/address/remove
=.id=your_id

I tried this one

/ip/address/remove
=.id=4

and also this one

/ip/address/remove
=.id=*4

nothing happen, I always receive this message

!trap=message=no such command.tag=sss
!done.tag=sss
 
rueny01
just joined
Topic Author
Posts: 10
Joined: Tue Jul 14, 2009 11:25 am

Re: How to edit and delete added IP address

Tue Jul 21, 2009 2:12 am

Ignore my last message it is now working..
I used this code

router.Send("/ip/address/remove");
router.Send("=.id=*4");

Thanks alot guys and GOD BLESS
 
MikroJunior
just joined
Posts: 2
Joined: Tue Aug 11, 2009 7:28 am

Re: How to edit and delete added IP address

Tue Aug 11, 2009 2:49 pm

Guys, I'm trying to set queue comment trough api using the following command but seems not be working

Send("/queue/simple/set");
Send("=.id=7/comment=test");

does anyone knows how to solve it ?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7169
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: How to edit and delete added IP address

Tue Aug 11, 2009 2:57 pm

Send("/queue/simple/set");
Send("=.id=7");
Send("=comment=test");
 
User avatar
vazhagelashvili
just joined
Posts: 2
Joined: Wed Dec 23, 2015 10:00 pm
Contact:

Re: How to edit and delete added IP address

Sat Mar 12, 2016 12:02 pm

...............................
Last edited by vazhagelashvili on Wed Sep 06, 2017 9:09 pm, edited 1 time in total.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: How to edit and delete added IP address

Mon Mar 14, 2016 10:58 pm

you're funny, but this topic is about API, not about Terminal, SSH or whatever

Who is online

Users browsing this forum: No registered users and 5 guests