cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2487
Views
5
Helpful
7
Replies

Changing configuration with Netconf on IOS XR

Hello,

i am trying to do soem very basic configuration changes on a ASR9K with netcon. I am able to retrieve configuration without problems. But i have no clue how to set something.

According to the XML Documentation there is a edit-config protocol operatino as well as a commit. What i try to do is the following

Get Interface config from System - looks likes this

<?xml version="1.0" encoding="UTF-8" standalone="no"?><rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"><get-config><source><running/></source><filter><Configuration><InterfaceConfigurationTable><InterfaceConfiguration><Naming><Active>act</Active><InterfaceName Match="GigabitEthernet0/1/0/10"/></Naming></InterfaceConfiguration></InterfaceConfigurationTable></Configuration></filter></get-config></rpc>

<InterfaceConfigurationTable MajorVersion="5" MinorVersion="3">

  <InterfaceConfiguration>

    <Naming>

      <Active>act</Active>

      <InterfaceName>GigabitEthernet0/1/0/10</InterfaceName>

    </Naming>

    <Shutdown>true</Shutdown>

  </InterfaceConfiguration>

</InterfaceConfigurationTable>

Good so far

Now the change (enable the interface)

<?xml version="1.0" encoding="UTF-8" standalone="no"?><rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"><edit-config><target><candidate/></target><config><InterfaceConfiguration ><Naming><Active>act</Active><InterfaceName>GigabitEthernet0/1/0/10</InterfaceName></Naming><Description>TestBeschreibung</Description><Shutdown>true</Shutdown></InterfaceConfiguration></config></edit-config></rpc>

That fails with "unknown element"

I tried several XML-requests, like with or withput the enclosing InterfaceConfigurationTable , with or without the config tag - it is always the same.

Does anybody have a workign example,or some documentation how a edit-config request has to look like ?

Thanks in advance

7 Replies 7

I finally got it. The correct XML syntax is
Configuration XML

All enclosed in rpc--Tag of course . And: Configuration Tag has an upper Case C .

It is a shame - but Junipers Netconf documentation is way better...

Sent from Cisco Technical Support iPhone App

Hi,

I'm experiencing the same problem.

Unfortunately from your answer I don't understand the exact xml that must be submitted to the netconf client in order to make it works.

Could you please attach a working example in this thread?

Thanks,

 

Pino

Hi,

 

yes - find a working RPC-Request attached. What you need to do is to enclose the whole InterfaceConfigurationTable XML-Structure within a "Configuration" XML-Element.

The example sets a description and the Interface MTU

 

Hope that helps

 

Thank you so much!

Just a question: I noticed you repeat twice che <description> tag.

Is there a reason, or it just a misprint?

 

Pino

Hm -  i copied it from a working request. Probably it's needed only once.

tanh00002
Level 1
Level 1

Hi Carsten B

I see you can get config with Netconf on IOS XR. 

Now i have a problem when get config on IOS as below discussion

https://supportforums.cisco.com/discussion/12365981/netconf-operation-failed

can you help me to solve this problem.

Thanks!

Sorry - i've got no experience with netconf on IOS

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: