Lab-6:Render CLI from Confd

In this lab I will demonstrate how to render cli interface from Confd. Confd is a configuration management sw for network devices. It provides capability to render cli, netconf, REST API, Web gui and various other management interfaces from YANG model. Thanks to Cisco Confd is available for free. In the free version you can render cli and NETCONF interfaces

I will be using YANG file provided in Confd documentation. But if you like you can create your own YANG file

Note: The YANG file I am using is called ‘links.yang’, you can download it from links. This file provides YANG model to create links with mac address. Change file extension to ‘.yang’

Pre-condition:

  • Download Confd sw. Try this link https://developer.cisco.com/site/confD/downloads/
  • Unzip & un-tar files
    • unzip confd-basic-6.1.linux.x86_64.zip
    • tar -xvf confd-basic-6.1.doc.tar.gz
  • Execute installer. Executable located in ../confd/bin. Installer set the path in confd.conf file which is located under ../confd/etc
    • sh confd-basic-6.1.linux.x86_64.installer.bin confd

 

Procedure:

  • Create a YANG file and put it under directory ../confd/etc/. In my case I have copied ‘links.yang’
  • Compile YANG file. It will create .fxs file
    • ../confd/bin/confdc –c <YANG file name>

../confd/bin/confdc –c links.yang

  • Launch Confd
    • ../confd/bin/confd –foreground –verbose -c ./confd.conf.

look for below message on the screen. This is the port# you will use to access Confd cli

<INFO> 10-Mar-2016::15:28:38.842 rtxl3rld05 confd[14486]: – Starting to listen for Internal IPC on 127.0.0.1:4565

  • In the second terminal window launch Confd
    • ../confd/bin/confd_cli –port 4565 –noaaa
Welcome to ConfD Basic
rtxl3rld05# show
-----------------^
syntax error: expecting
cli           - Display cli settings
confd-state   - Display ConfD status information
configuration - Display configuration changes
history       - Display CLI command history
jobs           - Display background jobs
nacm           - Access control
netconf-state - Statistics about NETCONF
notification   - Display notifications
parser         - Display parser information
running-config - Display current configuration
rtxl3rld05# config
rtxl3rld05(config)# config ?
Possible completions:
defaultLink linkLimitations links queueDisciplines
rtxl3rld05(config)# config link
Possible completions:
linkLimitations links
rtxl3rld05(config)# config links ?
Possible completions:
link
rtxl3rld05(config)# config links link ?
Possible completions:
<name:string> range
rtxl3rld05(config)# config links link mylink ?
Possible completions:
addr brd flags mtu <cr>
rtxl3rld05(config)# config links link mylink addr ?
Possible completions:
<string>
rtxl3rld05(config)# config links link mylink addr 01:01:01:01:01:01
Value for 'brd' (<string>): link
Error: bad value: "link" is an invalid value.
Value for 'brd' (<string>): 01:01:01:01:01:01
rtxl3rld05(config-link-mylink)# do show
----------------------------------------^
syntax error: expecting
cli           - Display cli settings
confd-state   - Display ConfD status information
configuration - Display configuration changes
history       - Display CLI command history
jobs           - Display background jobs
nacm           - Access control
netconf-state - Statistics about NETCONF
notification   - Display notifications
parser         - Display parser information
running-config - Display current configuration
 rtxl3rld05(config-link-mylink)# show
-------------------------------------^
syntax error: expecting
configuration     - Show a parameter
full-configuration - Show a parameter
history           - Display CLI command history
parser             - Display parser information
rtxl3rld05(config-link-mylink)#
rtxl3rld05(config-link-mylink)# exit
rtxl3rld05(config)# show ?
Possible completions:
configuration       Show a parameter
full-configuration   Show a parameter
history             Display CLI command history
parser               Display parser information
rtxl3rld05(config)# show configuration
config links link mylink
addr 01:01:01:01:01:01
brd 01:01:01:01:01:01
!
rtxl3rld05(config)#

One thought on “Lab-6:Render CLI from Confd

Leave a comment