cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
854
Views
0
Helpful
5
Replies

Trying to configure portfast trunk via NETCONF C9500

Seth Beauchamp
Level 1
Level 1

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?

5 Replies 5

Hamed Fazel
Spotlight
Spotlight

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.

@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

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

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

Marcel Zehnder
Spotlight
Spotlight

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>

 

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"