How to edit and delete added IP address

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

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”);

Cool, thanks alot

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

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

well, looking at ‘inglish’, I think that it’s not a machine translation… so please explain us, what is ‘son command’ =)

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

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

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

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 ?

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

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