Note: This feature is only supported on the 7210 SAS-K 2F1C2T and 7210 SAS-K 2F6C4T. |
This chapter describes the use of the Network Configuration Protocol (NETCONF) by the SR OS router to perform router management operations.
NETCONF is a standardized IETF configuration management and XML encoded protocol that can be used as an alternative to CLI or SNFMP to manage the SR OS routers. NETCONF is defined in RFC 6241, NETCONF Configuration Protocol (NETCONF). It is secure and connection-oriented, and can run over the SSHv2 transport protocol, in accordance with RFC 6242, Using the NETCONF Configuration Protocol over Secure Shell (SSH).
NETCONF uses Remote Procedure Call (RPC) messaging to facilitate communication between a NETCONF client and the NETCONF server that is running on the SR OS node. The RPC message and configuration data are encoded in an XML document. These XML documents are exchanged between the NETCONF client and a NETCONF server in a series of request and response type of messaging interactions. The SR OS NETCONF interface supports both configuration support and retrieval of operational information.
The following figure shows a NETCONF RPC messaging request.
As defined in RFC 6241, NETCONF can be conceptually partitioned into four layers; these are shown in the following figure.
The SR OS router can use NETCONF to perform the following router management operations:
NETCONF is not used to generate notifications on an SR OS router; for example, log events, syslog, or SNMP notifications (traps).
The equivalent of some admin commands are available through the SR OS NETCONF interface:
The bof, debug, tools, and other general CLI operational commands (for example, telnet or ping) are not supported through NETCONF on an SR OS router.
The SR OS NETCONF server supports both the base 1.1 and base 1.0 capabilities.
SR OS NETCONF supports both a CLI content layer and an XML-based content layer.
The SR OS NETCONF XML content layer configuration schema is described in a set of Alcatel-Lucent proprietary YANG modules. The configuration modules are advertised in the SR OS NETCONF server hello.
The configuration YANG data model closely aligns to the SR OS CLI configuration tree structure and commands.
A set of YANG modules are published and distributed as part of an SR OS image in the cflash/support directory (along with files like dictionary-freeradius.txt and stats.dtd).
The following areas of CLI do not have equivalent YANG data models:
SSH transport for NETCONF is supported on TCP port 830 with IPv4 or IPv6 in the “Base” routing instance.
NETCONF SSH sessions (similar to CLI, Secure Copy (SCP), and SSH File Transfer Protocol (sFTP) sessions) are subject to any configurable and non-configurable session limits; for example, inbound-max-sessions. The SSH server and NETCONF protocol must be enabled in the router configuration to use NETCONF.
Unlike CLI sessions, NETCONF sessions are not subject to automatic session timeout. Operators can manually disconnect sessions using the admin disconnect command.
NETCONF user accounts must exist on the SR OS to enable a client establishing a NETCONF session to log into the router. A new access type netconf is provided. The user must be configured with both console and netconf access.
Only authentication through the local user database is supported for NETCONF users (no RADIUS or TACACS+ authentication). Access to various CLI configuration and show commands (authorization) through NETCONF is controlled through the assigned user profile that is used to authenticate the underlying SSH session.
If a NETCONF request attempts to execute a CLI command that is outside the scope of its access profile, the system sends an error response.
The following example shows a user request where the show command usage is outside the scope of the user’s access profile.
The following example shows the reply.
The following base protocol operations are supported:
The <lock> and <unlock> base protocol operations are not supported.
The <error-option> operation is not supported. SR OS implements the stop-on-error behavior by default. The continue-on-error and rollback-on-error behaviors are not supported.
CLI content layer <get> operation is supported. XML content layer <get> operation is not supported.
A <get> request is analyzed for syntax errors before it is executed. If a syntax error is found, a single global <rpc-error> for the entire request is sent in the reply.
Responses are provided for each item in the request until the first item with an error is found. A <response> tag containing the error information, followed by an <rpc-error> tag (and sub-tags) is attached to the erroneous item. The reply is returned, and no subsequent items are not executed.
For a non-syntax error, the <rpc-error> for an individual item is placed after the </response> information and not included in the <response> tag.
The following example shows a <get> request with a non-syntax error in the second item.
The following example shows the reply.
The <get-config> operation returns non-default configuration by default (that is, the “trim” mode, as defined in RFC 6243).
The following values for the <test-option> parameter under <edit-config> are supported:
The <copy-config> and <delete-config> base protocol operations are supported for specific combinations of source and target datastores.
The <copy-config> operation is supported for the following combinations of sources and targets:
The <running> datastore cannot be a <target> for a <copy-config> operation.
Remote URL-to-remote URL copies are not supported. For example, if the primary-image is a remote URL, a <startup> to copy will fail with an error.
The <copy-config> operation uses the CLI content layer format. The format of the source and target is block CLI.
The <delete-config> operation is supported for the following targets:
The <delete-config> operation is not allowed on the <running> datastore.
The following support is available for the validate:1.1 capability:
The SR OS supports the following datastores:
Note: <url> is not a datastore in itself. |
The <candidate> datastore is not supported.
All configuration changes (<edit-config>) done to the <running> datastore through NETCONF take immediate operational effect.
The <startup> datastore and <url> tags can only be used with <copy-config> and <delete-config> and are not supported with any other operations (including <edit-config>, <get-config>, <get>, <validate>, and others).
The :startup capability is advertised in the SR OS NETCONF server <hello> as follows:
The <url> tags support the same options as CLI <file-url>: local URLs (CF) and remote URLs (ftp and tftp).
The :url capability is advertised in the SR OS NETCONF server <hello> as follows:
The following examples show the format of each URL scheme:
Note:
|
The <startup> datastore is identified by using the bof primary-config, secondary-config, and tertiary-config paths configured by the operator. The <startup> datastore is an alias for a special URL used for system startup with some extra resiliency (primary, secondary, and tertiary).
The BOF is not considered to be part of any configuration datastore.
Debug configurations (such as debug mirrors, or configurations saved using the admin debug-save command) are not considered to be part of any configuration datastore.
Configuration changes made through NETCONF are subject to CLI rollback operations (revert, save, and so on) and are included in the configuration when an admin save operation is performed in the CLI.
Use Ctrl-C in a NETCONF session to immediately terminate the session.
The SR OS NETCONF implementation does not support XML namespaces (xmlns). Any XML namespace or prefix declarations in the RPC tag are accepted and returned in the <rpc-reply> tag, but are ignored and unused. Any XML namespace or prefix declarations in the rest of the request are ignored and unused. The SR OS NETCONF server puts the correct NETCONF namespace declaration (“urn:ietf:params:xml:ns:netconf:base:1.0”) in all replies. See the following sections for more information:
The chunked framing mechanism is supported in addition to the EOM mechanism. As described in RFC 6242, Section 4.1 - Framing Protocol, "... If the :base:1.1 capability is advertised by both peers, the chunked framing mechanism (see Section 4.2) is used for the remainder of the NETCONF session. Otherwise, the old end-of-message-based mechanism (see Section 4.3) is used." See Example: chunked frame mechanism for more information.
Default data handling (for example, info vs info detail) is supported in accordance with the mechanisms detailed in RFC 6243. The SR OS NETCONF server supports the “trim” method and advertises it in the <hello> as follows:
Pseudo-transactional capabilities are supported. A user can save a rollback checkpoint (for example, prior to performing an <edit-config> or a series of <edit-config>) and, if required, later perform a rollback revert. See the following sections for more information:
The following example shows the standard NETCONF namespace “urn:ietf:params:xml:ns:netconf:base:1.0” used more than once in the <rpc> element.
In the following reply, the namespace is accepted and no error message is returned.
The following example shows a non-standard NETCONF base namespace defined in the <rpc> tag.
In the following reply, the non-standard namespace used in the <rpc> tag is ignored.
The following example shows a non-standard NETCONF namespace used in one of the tags, but not defined in the <rpc> tag.
In the following reply, the non-standard namespace used in the tag is ignored.
The following example shows a non-standard NETCONF namespace or prefix used in one of the tags but not defined in the <rpc> tag.
In the following reply, the non-standard namespace/prefix used in tag is ignored.
The following example shows a chunked message.
The following example shows the reply.
The following example shows two rollback items with responses.
The following example shows the reply.
The following example shows a syntax error in the request, which results in a global <rpc-error> reply.
The following example shows the reply.
The following example shows an error processing the request.
The following example shows the reply.
The following example shows an error in the second item of the request, resulting in no third item in the reply.
The following example shows the reply.
There is a set of configurable objects that are provisioned (added to the <running> datastore) automatically by SR OS; for example, log-id 99.
Some of these SPC objects can be deleted or removed by a user (deletable system provisioned configuration (SPC) objects):
Some SPC objects cannot be deleted (non-deletable SPC objects):
Some non-deletable SPC objects are visible in a <get-config> request, even if they are set to default values:
The following example shows a client on a Linux PC initiating a connection to an SR OS NETCONF server. In accordance with RFC 6242, the SSH session must be invoked using an SSH subsystem.
The following example shows an exchange of hello messages that include advertisement of capabilities.
The following is a message from the SR OS server.
The following is a reply from a NETCONF client.
XML is the default content layer format for the SR OS NETCONF server. When the XML format is used at the NETCONF content layer, configuration changes and configuration information retrieved are expressed as XML tags.
The XML formatted configuration information must be correctly ordered and has the same dependencies and behavior as the equivalent CLI commands.
An <edit-config> operation is supported with the <running> datastore only. The following <edit-config> operation attribute values are supported:
The “replace” operation is not supported as an attribute value for the <edit-config> operation.
Both “delete” and “remove” operations have the following behavior:
For this last case <shutdown operation="merge">true</shutdown> can be used instead to make the request valid:
The <edit-config> <default-operation> parameter is supported merge and none values. The “replace” value is not supported. An operation of "none" on a leaf node (inherited or direct) causes that leaf statement to be ignored. No error will be returned if the leaf does not exist in the data model.
For merge and create operations, the operations and tags specified in an <edit-config> request are order-aware and order-dependent, and the sequence of operations must follow the required sequence of the equivalent CLI commands. The <edit-config> is processed and executed in a top-down order. The same leaf can be enabled, disabled, or enabled and then disabled, and the final result is whatever was last specified for that leaf in the <edit-config> request.
For <delete> and <remove> operations, the SR OS NETCONF server will recursively unwind any children of the node being deleted or removed first before removing the node itself. The deepest child branch of the request is examined first and any leaves are processed, after which the server works backwards out of the deepest branches back up to the object where the delete operation was specified. If children branches of an object must be removed before deleting the object in CLI, the equivalent delete request in a NETCONF <edit-config> must contain all those children if they exist, such as if the children are configured in the config datastore).
In the following example, SR OS shuts down the test interface, deletes the interface, shuts down the VPLS, and removes it.
Note: The 'operation="merge"' is required in the shutdown nodes; otherwise, the inherited operation is <delete>, which is not supported on boolean leaves. |
In the preceding example, if other children of vpls 11 exist in the config besides the interface test specified in the delete request, and it is required to delete those children in CLI before vpls 11 is removed, the deletion request fails. All configured children must be specified in the delete request.
A <get-config> operation is supported with the <running> datastore only.
Subtree filtering for basic subtree selection is supported for XML content layer <get-config> requests. Post-filtering of the selected subtrees is not supported.
The subtree filtering behavior is as follows:
A <get-config> request that specify a non-existent list node or presence container will result in a reply that contains no data for those list nodes or containers. An <rpc-error> is not sent in this case.
See the following sections for examples of <get-config> request and response messages:
The following example shows a request that returns an error.
The following example shows the reply.
Multiple key leaves for the same key cannot be requested inside the same instance of the list name node; for example, <interface-name>abc</interface-name> <interface-name>def</interface-name>. Each key value must be inside its own instance of the list name node; for example, <interface> <interface-name>abc</interface-name> </interface> <interface> <interface-name>def</interface-name> </interface>.
The following example shows a valid <get-config> request for a content match node on a list key.
The following example shows a valid <get-config> request selection node that is a container.
The reply will contain the configuration for all child nodes of config>router.
The following example shows an invalid <get-config> request for a list name node that is an invalid selection node.
The following example shows the reply.
The following example shows an invalid <get-config> request for an empty leaf node that is an invalid selection node.
The following example shows the reply.
The following example shows an invalid <get-config> request for a key that is repeated in the same instance of the list node.
The following example shows the reply.
The full configuration (equivalent to the CLI command admin display-config) can be retrieved using a <get-config> request:
The following examples can be used after a NETCONF session has been established including the exchange of the <hello> messages.
The following example shows a <get-config> request and response to check whether NETCONF is shut down on the router.
The following example shows the reply.
The following example shows a <edit-config> request and response to create a basic VPRN service.
The following example shows the reply.
The following example shows a <edit-config> request and response to create a basic VPRN service with a SAP; the system creates the service/interface, but fails to create the SAP because the specified port encapsulation is invalid.
The following example shows the reply.
When the CLI format is used at the NETCONF content layer, configuration changes and information retrieved are expressed as untagged (non-XML) CLI commands; for example, CLI script.
The script must be correctly ordered and has the same dependencies and behavior as CLI. The location of CR/LF (ENTER) within the CLI for an <edit-config> request is significant and affects the processing of the CLI commands, such as which CLI branch is considered the “working context”. In the following two examples the “working context” after the commands issued are different.
Example 1
Example 2
After example 1, the CLI working context is the root, and immediately sending “dst-zone CEST” would return an error. After example 2, the CLI working context is config>system>time and sending “dst-zone CEST” would work as expected.
Configuration changes made using NETCONF trigger the same “change” log events (for example, tmnxConfigCreate) as a normal CLI user doing the same changes.
The <with-defaults> tag, as defined in RFC 6243, is not supported in a CLI content layer request.
The operator can get a full configuration, including defaults for a CLI content layer, using an empty <cli-info-detail>. The full configuration (equivalent to the CLI command admin display-config [detail]) can be obtained using a <get-config> request in a CLI content layer format with an empty <cli-info> or <cli-info-detail> tag inside a <config-format-cli-block>. The <report-all> tag is not supported.
The following post-processing commands are ignored: "| match" (pipe match), "| count" (pipe count) and ">" (redirect to file). CLI ranges are not supported for any command; for example, show card [1..5].
See CLI content layer examples for more information.
The following examples can be used after a NETCONF session has been established including the exchange of the <hello> messages.
The following example shows a configuration change request and response.
Note: The exit all command is not required at the beginning of the CLI block; it is automatically assumed by the SR OS NETCONF server. |
The following example shows the reply.
The following example shows a <get-config> request and response to retrieve configuration information.
The following example shows the reply.
The following example shows a <get-config> request and response to retrieve full configuration information.
Note: The <cli-info-detail/> request can be used to get the fill configuration, including default settings. |
The following example shows the reply.
The following example shows a <get> request.
The following example shows the reply.