Creating MD-CLI configuration from the classic CLI

This section describes a procedure to convert classic CLI configuration snippets into MD-CLI configuration snippets on an SR OS node initially operating in classic configuration mode. The MD-CLI configuration snippets can be ported to another node operating in model-driven configuration mode or saved to a file for later use. For these snippet conversions, mixed configuration mode must be enabled.

When operating in mixed or model-driven interface configuration mode, the SR OS router automatically converts the running configuration to the MD-CLI format in memory. For a node operating in classic or mixed interface configuration mode, any additional configuration entered in the classic CLI can easily be converted to the MD-CLI format. Converting the classic CLI configuration avoids the need to manually recreate the configuration in the MD-CLI and ensures all applicable configuration elements are properly converted to the MD-CLI format by the system. Any Nokia SR OS router, including a virtual simulator, Virtualized Service Router (VSR), or lab router, can be used to convert configurations.

See the 7450 ESS, 7750 SR, 7950 XRS, and VSR System Management Guide, section "Management Interface Configuration Mode" for more information about the management interface configuration mode.

The following example converts a configuration snippet which changes the system name.

Creating MD-CLI configuration from the classic CLI procedure

  1. Ensure mixed management interface configuration mode is enabled and persistent (from the classic CLI engine) and log out of the current session.
    *A:node-2# /configure system management-interface configuration-mode mixed
    Applying Changes to Model-Driven Database ... OK
    *A:node-2# logout
  2. Log in to a new CLI session.
    Login: admin
  3. (Optional) Save the configuration in the classic CLI format. The saved configuration can be used to return to a known baseline configuration.
    *A:node-2# admin save
    Writing configuration to cf3:config.cfg
    Saving configuration ... OK
  4. Switch to the MD-CLI engine and capture the configuration in the MD-CLI format to a file that can be used for later comparison. Because the admin save command is not supported in mixed configuration mode, use the admin show configuration command and redirect the output to the file.
    *A:node-2# //
    INFO: CLI #2052: Switching to the MD-CLI engine
    A:admin@node-2# admin show configuration > cf3:md-config.cfg
  5. Return to the classic CLI engine and enter the configuration to be converted.
    A:admin@node-2# //
    INFO: CLI #2051: Switching to the classic CLI engine
    A:node-2# configure system name new-node-7
  6. Switch to the MD-CLI engine. Compare the running configuration to the saved configuration file to display the additional configuration in the MD-CLI format.
    *A:new-node-7# //
    INFO: CLI #2052: Switching to the MD-CLI engine
    A:admin@new-node-7# configure global
    INFO: CLI #2054: Entering global configuration mode
    A:admin@new-node-7# compare from url cf3:md-config.cfg
        system {
    -       name "node-2"
    +       name "new-node-7"
  7. Copy and paste the differences in the MD-CLI engine on the target router or redirect to a file for later use. See Copying configuration elements and Using the file redirect option for more information.

MD-CLI configuration example output

The following example shows the conversion of a longer and more complex configuration that was pasted into the classic CLI using the preceding procedure.

A:node-2>config>service# info 
            bgp-auto-rd-range comm-val 1 to 5000
        sdp 21 mpls create
            path-mtu 1600
            no shutdown
        customer 1 name "1" create
            description "Default customer"
        pw-template 100 name "100" create
            split-horizon-group "shg1"
        vpls 1 name "VPLS1" customer 1 vpn 1 create
            description "Vpls 1 "
            service-mtu 1400
            split-horizon-group "vpls1" create
                description "Default description for SHG vpls1"
                route-distinguisher auto-rd
                route-target export target:100:1 import target:100:1
                pw-template-binding 100
                vpls-id 1:1
                no shutdown
                evi 1
                mpls bgp 1
                    split-horizon-group "vpls1"
                        resolution filter
                    no shutdown
            site "BGPMH1" create
                site-id 1
                split-horizon-group shg1
                failed-threshold 2
                no shutdown
            no shutdown
A:admin@node-2# compare from url cf3:md-config.cfg
+   service {
+       pw-template "100" {
+           split-horizon-group {
+               name "shg1"
+           }
+       }
+       system {
+           bgp-auto-rd-range {
+               ip-address
+               community-value {
+                   start 1
+                   end 5000
+               }
+           }
+       sdp 21 {
+           admin-state enable
+           delivery-type mpls
+           path-mtu 1600
+           ldp true
+           far-end {
+               ip-address
+           }
+       }
+       vpls "VPLS1" {
+           admin-state enable
+           description "Vpls 1 "
+           service-id 1
+           customer "1"
+           vpn-id 1
+           service-mtu 1400
+           bgp 1 {
+               route-distinguisher auto-rd
+               route-target {
+                   export "target:100:1"
+                   import "target:100:1"
+               }
+               pw-template-binding "100" {
+               }
+           }
+           bgp-ad {
+               vpls-id "1:1"
+           }
+           bgp-evpn {
+               evi 1
+               mpls 1 {
+                   split-horizon-group "vpls1"
+                   ingress-replication-bum-label true
+                   auto-bind-tunnel {
+                       resolution filter
+                       resolution-filter {
+                           rsvp true
+                       }
+                   }
+               }
+           }
+           split-horizon-group "vpls1" {
+               description "Default description for SHG vpls1"
+           }
+           bgp-mh-site "BGPMH1" {
+               admin-state enable
+               id 1
+               failed-threshold 2
+               shg-name "shg1"
+           }
+       }
+   }
Note: Consider the following guidelines when converting classic CLI to MD-CLI configuration:
  • Revert to a saved classic CLI configuration or save changes to the classic CLI configuration in each CLI engine when converting a configuration snippet so that the MD-CLI comparison displays only the snippet that is converted.

  • Avoid configuration snippets that overlap with the existing configuration, including default configuration snippets, because they may not be displayed as a difference. A minimum configuration is recommended to ensure that all differences are displayed.

  • Consider using the same type of router for the conversion as the router the configuration is intended for (although this is not a strict requirement), because some CLI commands are specific to a product family or chassis.