I have done few configurations like ISIS,BGP on my device from NETCONF client.
Now , i want to check Copy-config operation. Can you please help me what should be in my target parameter in below XML:
my router ip is: 192.168.171.44 (to login i do ssh root@192.168.171.44 )
CASE I: to copy on the same router at path: /sdboot/up
CASE II: to copy on different server at path: /bgf/sdh-home
mnovak
January 3, 2018, 12:34pm
2
Hello,
seems like you did not paste XML content.
Here is example of <copy-config>
copying from startup
to running
(change according to your scenario)
<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
</capabilities>
</hello>
]]>]]>
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<copy-config>
<target>
<startup/>
</target>
<source>
<running/>
</source>
</copy-config>
</rpc>
]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
<close-session/>
</rpc>
]]>]]>
hi mnovak,
I am looking for example where my target is URL.
the example given in RFC is not in detail.
so can you give me XML for copy-config where my source is “running”
and target is:
URL to copy in same router (192.168.171.44) at /sdboot/up
URL to copy on different server (172.18.111.146) at /sdh_home/bgf
mnovak
January 15, 2018, 12:33pm
4
Hello,
please see answer here:
Hi Ramith,
First enable the url capability in your confd.conf ConfD configuration file by adding the following in the <capabilities> section of the <netconf> section:
<url>
<enabled>true</enabled>
<file>
<rootDir>/tmp</rootDir>
</file>
</url>
See https://tools.ietf.org/html/rfc6241#section-8.8 for more on the url capability.
Then you send a NETCONF <copy-config> operation like this:
<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0…
Do not forget to enable url
capability in confd.conf
and add 3 times slash /
in the url, e./g.
<url>
<enabled>true</enabled>
<file>
<rootDir>/tmp</rootDir>
</file>
</url>
<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
</capabilities>
</hello>
]]>]]>
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<copy-config>
<target>
<url>file:///config.xml</url>
</target>
<source>
<running/>
</source>
</copy-config>
</rpc>
]]>]]>
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
<close-session/>
</rpc>
]]>]]>
hi ,
I Tried with 3 slash ‘/’ , but my session is getting disconnected:
copy-config
target
url ftp:///admin:admin1@192.168.171.44/sdboot/up/new-1.xml /url
/target
source
running/
/source
/copy-config
When i try with 2 slash, copy is successful . i.e. i am able to see the file in right path but i also see error message after the copy-config XML is sent:
copy-config
target
url ftp://admin:admin1@192.168.171.44/sdboot/up/new-1.xml /url
/target
source
running/
/source
/copy-config
Error:
rpc-reply xmlns=“urn:ietf:params:xml:ns:netconf:base:1.0” message-id=“5”
rpc-error
error-type application /error-type
error-tag operation-failed /error-tag
error-severity error /error-severity
error-app-tag url-write-failed /error-app-tag
error-path
/rpc/copy-config/source/config/running
/error-path
error-message xml:lang=“en” application protocol error /error-message
error-info
bad-element url /bad-element
/error-info
/rpc-error
/rpc-reply
Please assist
cohult
February 1, 2018, 1:53pm
6
Was there anything unclear in my replies in the other topic you have on the URL capability?
Are you looking for something like this?:
$ # We enable the netconf trace log
$ cat confd.conf | grep -B 2 -A 2 netconf.trace
<netconfTraceLog>
<enabled>true</enabled>
<filename>./netconf.trace</filename>
<format>pretty</format>
</netconfTraceLog>
$ # Start ConfD
$ confd -c confd.conf --addloadpath $CONFD_DIR/etc/confd
$ cat copy-running-to-ftp-url.xml
<copy-config>
<target>
<url>ftp://root:mypassword@192.168.171.44/my-running-config.xml</url>
</target>
<so…
Not sure how this relates to what is configured on your device, but you can try something like this:
confd.conf example :url setting:
...
</capabilities>
...
<url>
<enabled>true</enabled>
<file>
<enabled>true</enabled>
<rootDir>/my/dir</rootDir>
</file>
<ftp>
<enabled>true</enabled>
</ftp>
<sftp>
<enabled>true</enabled>
</sftp>
</url>
</capabilities>
...
edit-config from file to running:
<edit-config>
<target>
<running/>
</targ…
mnovak
February 2, 2018, 9:48am
7
url ftp:///admin:admin1@192.168.171.44/sdboot/up/new-1.xml/url
maybe, you can test with file
url first, not ftp
, to see if it works in your env.
Once file
is working, you may look into ftp
issue.
hi
I tried with file, but it failed.
With FTP, it copies correctly but also gives error as rpc-reply,
rpc-reply must be OK
mnovak
February 2, 2018, 10:22am
9
Please, can you try following example in your environment (steps in README
):
https://cisco.box.com/s/7pphouazrs03wxiqh1ug9ce6ud4zp2xm
It creates file /tmp/config.xml
with copy-config
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<copy-config>
<target>
<url>file:///config.xml</url>
</target>
<source>
<running/>
</source>
</copy-config>
</rpc>
Yes , It created the file config.xml.
But again, I see error message also saying BAD URL ELEMENT
mnovak
February 2, 2018, 10:42am
11
Please, can you paste the error message? Which ConfD version do you use?
I have ok
reponse (ConfD 6.5):
netconf-console netconf-copy-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
"<?xml version="1.0" encoding="utf-8"?>
application
operation-failed
error
url-write-failed
/rpc/copy-config/source/config/running
application protocol error
url
"
mnovak
February 2, 2018, 12:03pm
13
Ok, you got different response. Which ConfD version is it? Do you have any chance to try on plain Linux 64bit (I’m using Xubuntu 17.10).
cohult
February 2, 2018, 1:10pm
14
I would be more interested in what your developer log (with developerLogLevel set to trace in confd.conf) say.
The “application protocol error” indicates that you may have an external database (config data outside of CDB) that is supposed to serve a tailf:callpoint callback but fail to do so when ConfD asks for the data to be transfered to the file on the remote ftp server.