OpenConfigd is software which manages OpenConfig common data models for networking. It handles networking protocol configuration as well as any generic configuration parameters.
OpenConfigd reads YANG model definition then generate configuration schema from it.
Following command build openconfigd and cli_command.
$ go get github.com/lagopus/openconfigd/...CLI command build and set up.
$ cd $GOPATH/src/github.com/lagopus/openconfigd/cli
$ ./build.sh
$ sudo make installwill install cli command to /usr/local/bin.
CLI completion file called cli file exists under bash_completion.d as well. On
Ubuntu platform, this file should be installed under /etc/bach_completion.d
$ cd $GOPATH/src/github.com/lagopus/openconfigd/bash_completion.d
$ sudo cp cli /etc/bash_completion.d/Invoke openconfigd, then start cli. "show version" display version information.
$ openconfigd &
$ cli
ubuntu>
ubuntu> show version
Developer Preview version of openconfigd
ubuntu>openconfigd takes YANG module names as arguments. When no YANG module is specified, default coreswitch.yang is used. '.yang' saffix is optional. Use can specify multiple YANG file. So
$ openconfigd lagopus ietf-ipwill load both lagopus.yang and ietf-ip.yang modules.
There are several other options.
- -c, --config-file= active config file name (default: coreswitch.conf)
- -p, --config-dir= config file directory (default: /usr/local/etc)
- -y, --yang-paths= comma separated YANG load path directories
- -h, --help Show this help message
-c option specify active config file name. -p option specify config file save directory. When full path is specified to -c option's base directory overrides the -p option config file directory.
-y option specify YANG file load path. Use can specify multiple YANG load path with colon separated list.
$ openconfigd -y /usr/shared/yang:/opt/yangwill search both /usr/shared/yang and /opt/yang directory. Default YANG laod path $GOPATH/src/github.com/lagopus/openconfigd/yang is automatically added.
OpenConfigd support CLI scripting. All operational and configuration mode commands can run from script.
Here is an example:
#! /bin/bash
source /etc/bash_completion.d/cli
configure
set system host-name ubuntu
commit
run show version