< get > , < get-config > , < edit-config > , < copy-config > , < delete-config > , < lock > , < unlock > , < close-session > , < kill-session > .
set system services netconf ssh
ssh username @ host -s netconf
<!-- No zombies were killed during the creation of this user interface -->
<!-- user test, class j-super-user -->
< hello >
< capabilities >
< capability > urn:ietf:params:xml:ns:netconf:base:1.0 </ capability >
< capability > urn:ietf:params:xml:ns:netconf:capability:candidate:1.0 </ capability >
< capability > urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0 </ capability >
< capability > urn:ietf:params:xml:ns:netconf:capability:validate:1.0 </ capability >
< capability > urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file </ capability >
< capability > xml.juniper.net/netconf/junos/1.0 </ capability >
< capability > xml.juniper.net/dmi/system/1.0 </ capability >
</ capabilities >
< session-id > 666 </ session-id >
</ hello >
]] > ]] >
* This source code was highlighted with Source Code Highlighter .
show version and haiku
< hello >
< capabilities >
< capability > urn:ietf:params:xml:ns:netconf:base:1.0 </ capability >
< capability > urn:ietf:params:xml:ns:netconf:capability:candidate:1.0 </ capability >
< capability > urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0 </ capability >
< capability > urn:ietf:params:xml:ns:netconf:capability:validate:1.0 </ capability >
< capability > urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file </ capability >
< capability > xml.juniper.net/netconf/junos/1.0 </ capability >
< capability > xml.juniper.net/dmi/system/1.0 </ capability >
</ capabilities >
</ hello >
]] > ]] >
* This source code was highlighted with Source Code Highlighter .
< rpc message-id ="100" xmlns ="urn:ietf:params:xml:ns:netconf:base:1.0" >
< get-config >
< source >
< running />
</ source >
< filter type ="subtree" >
< configuration >
< protocols />
</ configuration >
</ filter >
</ get-config >
</ rpc >
* This source code was highlighted with Source Code Highlighter .
< rpc-reply message-id ="100" xmlns:junos ="http://xml.juniper.net/junos/11.2R5/junos" >
< configuration junos:commit-seconds ="1311003260" junos:commit-localtime ="2012-06-06 11:21:40 UTC" junos:commit-user ="test" >
< protocols >
SKIPPED
</ protocols >
</ configuration >
</ rpc-reply >
* This source code was highlighted with Source Code Highlighter .
< rpc-reply message-id ="110" xmlns ="urn:ietf:params:xml:ns:netconf:base:1.0" >
< rpc-error >
< error-type > rpc </ error-type >
< error-tag > missing-attribute </ error-tag >
< error-severity > error </ error-severity >
< error-info >
< bad-attribute > message-id </ bad-attribute >
< bad-element > rpc </ bad-element >
</ error-info >
</ rpc-error >
</ rpc-reply >
* This source code was highlighted with Source Code Highlighter .
< rpc-reply message-id ="201" xmlns ="urn:ietf:params:xml:ns:netconf:base:1.0" >
< ok />
</ rpc-reply >
* This source code was highlighted with Source Code Highlighter .
< rpc message-id ="100500" xmlns ="urn:ietf:params:xml:ns:netconf:base:1.0" >
< close-session />
</ rpc >
* This source code was highlighted with Source Code Highlighter .
<? xml version ="1.0" encoding ="UTF-8" ? >< rpc-reply message-id ="101" xmlns =" urn:ietf:params:netconf:base:1 . 0 &# 60 ;/ cmd > a >< cli-config-data >< cmd > !
</ cmd > nterface Vlan777
</ cmd > description TEST
</ cmd > ip address 192.168.0.1 255.255.255.0
</ cmd ></ cli-config-data ></ data ></ rpc-reply > ]] > ]] >
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/135259/