This piqued my interest, so I whipped up a quick program to do some
testing.  I've attached the resulting program, which when run against
my 6500 running 12.2(33)SXI produces a copy of the running config.

Some things I observed:

1.  Netconf over SSHv2 (http://www.rfc-editor.org/rfc/rfc4742.txt)
requires a "hello" message to be sent by the client, which didn't
appear to be documented in any of the Cisco docs.

2. If the "hello" message had problems, no error message is sent to
the client (an error message is logged though).

4. The namespace that it sends ("urn:ietf:params:netconf:base:1.0") is
different from what it expects
("urn:ietf:params:xml:ns:netconf:base:1.0") which I found a little
confusing.

5. I wasn't able to get any of the command fiiltering working.

The script is in Python, and you'll need the Paramiko (SSHv2) and lxml
(XML parsing) extensions.  Sample output (actual config file
truncated):

<?xml version='1.0' encoding='UTF-8'?>
<hello>
  <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:writeable-running:1.0</capabi
lity>
    <capability>urn:ietf:params:netconf:capability:startup:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:url:1.0</capability>
    <capability>urn:cisco:params:netconf:capability:notification:1.0</capability
>
  </capabilities>
  <session-id>1391240248</session-id>
</hello>

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:netconf:base:1.0" message-id="101">
  <data>
    <cli-config-data-block>!
! Last configuration change at 22:43:26 CST Mon Feb 2 2009 by Cisco
! NVRAM config last updated at 10:23:27 CST Mon Feb 2 2009 by Cisco
!
...
netconf ssh
!
end
</cli-config-data-block>
  </data>
</rpc-reply>

-- 
Jeff Ollie

"You know, I used to think it was awful that life was so unfair. Then
I thought, wouldn't it be much worse if life were fair, and all the
terrible things that happen to us come because we actually deserve
them? So, now I take great comfort in the general hostility and
unfairness of the universe."

        -- Marcus to Franklin in Babylon 5: "A Late Delivery from Avalon"
_______________________________________________
cisco-nsp mailing list  [email protected]
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/

Reply via email to