01-24-2014 04:24 AM
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
01-26-2014 08:34 AM
I finally got it. The correct XML syntax is
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
11-18-2014 06:29 AM
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
11-19-2014 01:28 AM
11-19-2014 09:00 AM
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
12-01-2014 11:22 PM
Hm - i copied it from a working request. Probably it's needed only once.
12-01-2014 04:55 PM
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!
12-01-2014 11:24 PM
Sorry - i've got no experience with netconf on IOS
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