170
Loading the configuration
After you perform the load operation, the loaded settings are merged into the current configuration as
follows:
•
New settings are directly loaded.
•
Settings that already exist in the current configuration are replaced by those loaded from the
configuration file.
Some settings in a configuration file might conflict with the existing settings. For the settings in the file
to take effect, delete the existing conflicting settings, and then load the configuration file.
# Copy the following text to the client to load a configuration file for the device:
<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<load>
<file>
Specify the configuration file name
</file>
</load>
</rpc>
The name of the specified configuration file must start with the storage media name and end with
the
.cfg
extension.
After receiving the load request, the device returns a response in the following format if the load
operation is successful:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<ok/>
</rpc-reply>
Example for saving the configuration
Network requirements
Save the current configuration to configuration file
my_config.cfg
.
Configuration procedure
# Enter XML view.
<Sysname> xml
# Notify the device of the NETCONF capabilities supported on the client.
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>
urn:ietf:params:netconf:base:1.0
</capability>
</capabilities>
</hello>
# Save the configuration of the device to configuration file
my_config.cfg
.
<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<save>
<file>my_config.cfg</file>