165
Saving, rolling back, and loading the configuration
Use NETCONF to save, roll back, or load the configuration.
Performing the save, rollback, or load operation consumes a lot of system resources. Do not perform
these operations when the system resources are heavily occupied.
Saving the configuration
# Copy the following text to the client to save the device configuration to the specified file:
<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<save OverWrite="false">
<file>
Specify the configuration file name
</file>
</save>
</rpc>
The name of the specified configuration file must start with the storage media name and end with
the
.cfg
extension. If the text includes the file column, you must specify the file name. The specified
file will be used as the next-startup configuration file. If the text does not include the file column, the
configuration is automatically saved to the default main next-startup configuration file.
The
OverWrite
attribute determines whether to overwrite the specified file if the file already exists.
•
If the attribute uses the default value
true
, the current configuration is saved, and the original
file is overwritten.
•
If the attribute value is set to
false
, the current configuration cannot be saved, and the system
displays an error message.
After receiving the save request, the device returns a response in the following format if the save
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>
Rolling back the configuration based on a configuration file
# Copy the following text to the client to roll back the configuration based on a configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rollback>
<file>
Specify the configuration file name
</file>
</rollback>
</rpc>
After receiving the rollback request, the device returns a response in the following format if the
rollback 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>