Community discussions

MikroTik App
 
User avatar
eworm
Forum Guru
Forum Guru
Topic Author
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

comment in export for broken reference

Tue Sep 14, 2021 10:08 am

RouterOS configuration works with referencing configuration items. Things break when an item is removed and reference points to a non-existent id:
[admin@ros7] > /interface/bridge/add name=test
[admin@ros7] > /ip/address/add address=10.0.0.1/24 interface=test
[admin@ros7] > /interface/bridge/remove test
[admin@ros7] > /ip/address/print
Flags: I, D - DYNAMIC
Columns: ADDRESS, NETWORK, INTERFACE
ADDRESS NETWORK INTERFACE
0 D 10.7.7.159/24 10.7.7.0 bridge
1 I 10.0.0.1/24 10.0.0.0 *B
When printing the configuration you see the dangling id (*B in this case). However exporting the configuration you can not see this:
[admin@ros7] > /ip/address/export
/ip address
add address=10.0.0.1/24 network=10.0.0.0
In case of broken references I would like to see a comment in export showing the issue, something like:
[admin@ros7] > /ip/address/export
/ip address
# WARNING: broken reference to internal id *B
add address=10.0.0.1/24 network=10.0.0.0
I contacted support (SUP-58120) an their answer was:
Thank you for your request, if there will be more, similar request like yours, we will see how this can be added in the future versions.
So if you think this would be a good addition please cast your vote by opening a support ticket.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: comment in export for broken reference

Tue Sep 14, 2021 10:29 am

Is not a 7 prerogative, also on 6 the same:

terminal code

pri
Flags: X - disabled, I - invalid, D - dynamic 
 #   ADDRESS            NETWORK         INTERFACE                                
 0 I 6.6.6.6/24         6.6.6.0         *B                                       

export
/ip address
add address=6.6.6.6/24 network=6.6.6.0
 
User avatar
eworm
Forum Guru
Forum Guru
Topic Author
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: comment in export for broken reference

Tue Sep 14, 2021 12:04 pm

Yes, it is the same there. As active development moved to v7 and my examples use new syntax I decided to post here.
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: comment in export for broken reference

Wed Sep 22, 2021 10:05 am

I think it would be better if the export for ip address followed the same rule as for bridge port: export interface ID instead of omitting interface attribute.

[admin@MikroTik] > /interface bridge port export
# sep/22/2021 09:00:35 by RouterOS 7.1rc4
/interface bridge port
add bridge=docker interface=veth1

[admin@MikroTik] > /interface veth remove veth1

[admin@MikroTik] > /interface bridge port export
# sep/22/2021 09:01:37 by RouterOS 7.1rc4
/interface bridge port
add bridge=docker interface=*E
 
User avatar
eworm
Forum Guru
Forum Guru
Topic Author
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: comment in export for broken reference

Wed Sep 22, 2021 1:29 pm

Fine with me... Thought searching for the comment should be easier.
But there should be a way to detect broken reference in export. Just silently ignoring is the wrong way.

Who is online

Users browsing this forum: No registered users and 20 guests