09-27-2024 08:33 AM
Hello, I have been trying to use netconfig to configure 'spanning-tree portfast edge trunk' on a C9500-48Y4C running XE17.2.3. I keep getting error 'ncclient.operations.rpc.RPCError: inconsistent value: Device refused one or more commands'.
Below is the XML I am trying to use. This is also how the XML appears if I manually configure this via CLI, then pull the config with netconf.
<config>
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
<interface>
<TwentyFiveGigE>
<name>1/0/2</name>
<spanning-tree xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-spanning-tree">
<portfast>
<edge />
<trunk />
</portfast>
</spanning-tree>
</TwentyFiveGigE>
</interface>
</native>
</config>
If i remove <trunk />, it will configure 'spanning-tree portfast edge', which isn't quite what I need. Any suggestions?
09-27-2024 09:10 AM - edited 09-27-2024 09:11 AM
I checked the Cisco-IOS-XE-spanning-tree Yang model. It seems this configuration is not implemented in the yang files so you can't configure it by Yang or XML.
By Yang models, you can just put the port in Edge mode and you can not select what type of edge.
09-27-2024 09:39 AM
@Hamed Fazel thats a sharp observation, it looks like enabling both edge and trunk options simultaneously within the portfast container for a single interface using netconf isnt supported, oddness. Wondering here... could you use two separate calls? Place in edge, then the second to put in trunk? Thinking out loud, it late here, no coffee and its Friday.. idk
09-27-2024 10:15 AM
Unfortunately no, it doesn't look like it. I've tried it a variety of ways, but running the <trunk /> tag separately after the <edge /> tag goes through on its own, also gives the error 'inconsistent value: Device refused one or more commands'.
An odd observation though, if I run the <edge /> tag successfully, then try the <trunk /> and get the error, i have noticed in the cli it removes the 'spanning-tree portfast edge' command. If i again try to run the <edge /> tag by its self, i get an 'ok' back but the command isn't in the cli. I have to run 'no spanning-tree portfast edge' in CLI (even though it doesn't appear there) for it to take the command
09-27-2024 11:59 PM - edited 09-28-2024 12:00 AM
I don't have access to a switch right now. Is your port configured with "switchport mode trunk"? I'm wondering if the inconsistent value is because you try to configure a "trunk" feature on a "access" port. Long story short, does this work?
<config>
<native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native">
<interface>
<TwentyFiveGigE>
<name>1/0/2</name>
<switchport-conf>
<switchport>true</switchport>
</switchport-conf>
<switchport-config>
<switchport>
<mode xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-switch">
<trunk/>
</mode>
</switchport>
</switchport-config>
<spanning-tree xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-spanning-tree">
<portfast>
<trunk/>
<edge/>
</portfast>
</spanning-tree>
</TwentyFiveGigE>
</interface>
</native>
</config>
09-30-2024 05:48 AM
This crossed my mind as well, unfortunately no, it still doesn't work. I also tried your configuration exactly as you posted it, still get "inconsistent value: Device refused one or more commands"
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide