We have encountered an issue with our KLISH configuration where entering the interface command in two different formats—such as:
—results in duplicate interface entries in the running configuration stored by konfd.
In our XML configuration, we defined the commands as follows:
<VIEW name="configure-view">
<COMMAND name="interface"
help="Select an interface to configure"
view="configure-if-view"
viewid="iface=${iface_name}">
<PARAM name="iface_name"
help="Interface name"
ptype="IFACE_NAME"/>
<CONFIG priority="0x2001" pattern="^interface ${iface_name}$"/>
</COMMAND>
<COMMAND name="interface Ethernet"
help="Ethernet IEEE 802.3"
view="configure-if-view"
viewid="iface=Ethernet${iface_num}">
<PARAM name="iface_num"
help="Ethernet interface number"
ptype="IFACE_NUM"/>
<CONFIG priority="0x2001" pattern="^interface Ethernet${iface_num}$"/>
</COMMAND>
<COMMAND name="interface Vlan"
help="Vlan interface"
view="configure-if-view"
viewid="iface=Vlan${iface_num}">
<PARAM name="iface_num"
help="vlan interface number"
ptype="IFACE_NUM"/>
<CONFIG priority="0x2001" pattern="^interface vlan${iface_num}$"/>
</COMMAND>
</VIEW>
<VIEW name="configure-if-view"
prompt="${SYSTEM_NAME}(config-if-${iface})# "
depth="1">
<NAMESPACE ref="configure-view"
help="false"
completion="true"/>
</VIEW>
Observed Behavior:
When navigating into an interface configuration, even if the interface has already been configured (with subordinate commands such as shutdown or ip address), entering the command again creates a new configuration header. For example, after configuring interface Ethernet 2 and adding subcommands, subsequent entries cause duplicates like:
--
You received this message because you are subscribed to the Google Groups "klish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to klish+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/klish/2d03cc92-b9cf-4f85-8a4a-51e8764930a5n%40googlegroups.com.
Hi Serj,
Thank you very much for your detailed explanation.
Given this, I'm wondering if there's a way to resolve the issue so that both the normalized and non-normalized inputs are consolidated into a single, normalized configuration entry (preferably in the format "interface Ethernet2"). Any further guidance or suggestions on how to achieve this would be greatly appreciated.
Thanks again for your help!
To view this discussion visit https://groups.google.com/d/msgid/klish/b2ef59ac-46e3-4c33-97c2-702a54b932a0n%40googlegroups.com.
Thank you very much for your detailed suggestions.
I did try using konf -h, but it only shows the following minimal output:
konf -hTo view this discussion visit https://groups.google.com/d/msgid/klish/842dd33e-7727-4a72-ba85-d1d775b98b75n%40googlegroups.com.