Router OS 'remove' command.

Dear Mikrotik,

In Mikrotik,

We can use ‘remove’ command to remove certain configuration.
But, we need ‘Item Number’ to use ‘remove’ command.
to get ‘Item Number’, we have to use another command ‘print’.
Or else, we can use ‘find’ command.
This will not be ‘OK’ for newbie.


In Cisco,

Just use ‘no’ to remove configuration.

Example,
In cisco,
interface FastEthernet 0/0
ip address 192.168.1.1 255.255.255.0

we want remove IP address, then,
no ip address 192.168.1.1 255.255.255.0

In Mikrotik,
/ip address
add address=192.168.1.1/24 interface=ether1

we want to remove IP address, then,
/ip address
print

ADDRESS NETWORK INTERFACE

0 192.168.1.1/24 192.168.1.0 ether1

/ip address
remove 0

so, why can’t we use simply remove Like,

/ip address
remove address=192.168.1.1/24 interface=ether1

If yes,
we will be a lot easy in remove configuration scripting.

Please kindly consider.

Cisco works differently from MikroTik.
These routers are both not for newbies.
There are enough routers on the market that are much easier to configure than either Cisco or MikroTik.
I don’t think either of these manufacturers are focussing on the newbies market…

You already can do this sort of
/ip address remove [find address=“192.168.1.1/24”]

Except that instead of “no” you type “find” :smiley:

One thing that could be interesting was to remove the rule with the opposite command of its creation.
Example:
add chain=AP_intra comment=“AP usa DNS Intranet” dst-port=53 protocol=udp → This one create this rule
removechain=AP_intra comment=“AP usa DNS Intranet” dst-port=53 protocol=udp → This one would remove the rule. The number system is good, and should be kept. But this could simplify some scripts and whatnot.

What is wrong with find? In our case, you don’t have to enter the whole rule, just find based on content in the rule.

Find is great, don’t get me wrong. It’s just that to declare it in a script, I would have to run a find to match the whole rule - or accept the risk of removing the wrong one.
Well, I could run a find to match the whole rule, couldn’t I? Mmmmm… Nevermind. Find works for me. Old habits and all. :smiley:

what if you want to migrate and you want to remove some unnecessary configuration and add some configuration ?
we have to plan for “find”. which syntax would be appropriate. (we worry that if we remove wrongly?)
Or just print current configuration and copy to notepad.
In “add” command, replace it with “remove” and select all and paste in terminal.
which is better?