In Cisco IOS XE Cupertino 17.7.1 and later releases, you can automatically translate IOS commands into relevant NETCONF-YANG XML or RESTCONF-JSON request messages. You can analyze the generated configuration messages and familiarize with the Xpaths used in these messages. The generated configuration in the structured format can be used to provision other devices in the network; however, this configuration cannot be modified.
Review the CLI running configuration
- Review the running configuration in the good ole fashioned CLI using
show run
Generate the XML of the current running config using netconf-xml
Generate the JSON of the current running config using restconf-json
Update the config
[guestshell@guestshell ~]$ netconf-format > config.before
(this will take a few seconds to complete).- Escape from the c9300 using
[guestshell@guestshell ~]$ exit
. - Escape from the c9300 using
c9300# exit
. - Run the script by running the command
auto@pod5-xelab:~$ cd ~/cli2yang ; ./update-config.sh
. - What is the printed flag (a hashed string) when updating the configuration through the script above?
How many lines of config have changed after running ./cli2yang/update-config.sh
?
- Run the following commands from the Guest Shell prompt.
If you are not already connected to the switch, then connect with:
telnet c9300
. Then enter the Guest Shell from the C9300 prompt with:guestshell
.
[guestshell@guestshell ~]$ netconf-format > config.after (this will take a few seconds to complete)
[guestshell@guestshell ~]$ diff config.before config.after | wc -l (Use diff again while using line count tool)
Run the following to see the changes in the config:
[guestshell@guestshell ~]$ diff config.before config.after
There is a short amount of output and the final line is the flag, including the open and closing brackets <
and >
.
- Determine which feature was added by running
[guestshell@guestshell ~]$ diff config.before config.after
.
After running the update-config.sh
script, notice the new config that was added. What is the feature found using
the GET
method? Note: update-config.sh
applies the changes in terraform.tf
.