Some packages are required. The following are example of debian-based packages:
sudo apt install flex bison git make gcc libnghttp2-dev libssl-dev
Check out the following GIT repos:
- https://github.com/clicon/cligen.git/
- https://github.com/clicon/clixon.git/
- https://github.com/clicon/clixon-controller.git/
- https://github.com/clicon/clixon-pyapi.git/
The source is built as follows.
sudo useradd clicon -N sudo groupadd clicon sudo usermod -a -G clicon `whoami`
cd cligen ./configure make sudo make install
cd clixon ./configure make sudo make install
Either use PIP or Debian packages.
PIP:
cd clixon-pyapi sudo -u clicon pip3 install -r requirements.txt sudo python3 setup.py install
Debian:
cd clixon-pyapi sudo ./requirements-apt.sh sudo python3 setup.py install
cd clixon-controller ./configure make sudo make install
To make the controller the default clixon application:
(cd /usr/local/etc/clixon; ln -s /usr/local/etc/clixon/controller.xml clixon.xml)
It is recommended to NOT run the controller as root.
In the clixon-controller source folder there is a file named clixon-controller.service which can be used to run the Controller backend using SystemD.
To install the SystemD service either copy the file manually:
cp clixon-controller.service /usr/lib/systemd/system/
Or use the Makefile and run "sudo make systemd" to copy the file to /usr/lib/systemd/system/.
$ sudo make systemd /usr/bin/install -c clixon-controller.service /usr/lib/systemd/system/ Systemd service installed, run systemctl enable clixon-controller.service to enable it
After copying the file, run the following commands to enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable clixon-controller.service sudo systemctl start clixon-controller.service sudo systemctl status clixon-controller.service
The Controller configure script (generated by autoconf) includes several options apart from the standard ones.
- These include (standard options are omitted)
--enable-debug Build with debug symbols, default: no --with-cligen=dir Use CLIGEN here --with-clixon=dir Use Clixon here --with-clicon-user=user Run as this user in example and test --with-clicon-group=group Run as this group in example and test
Install the python code by copy:
sudo cp clixon_server.py /usr/local/bin/
Add a new clicon user and install the needed Python packages, the backend will start the Python server and drop the privileges to this user:
sudo useradd -g clicon -m clicon
The controller needs to be able to connect to devices via a NETCONF SSH sub-system.
Note
Devices must be reachable from the controller via a NETCONF SSH subsystem
Setting up he SSH subsystem is different for different device vendors.
When done, you can verify reachability as follows. Example: You login and start the controller as user ctrl, the device user is admin and the IP address is 172.17.0.3.
Verify the SSH subsystem works as follows:
ctrl> ssh [email protected] -s netconf <?xml version="1.0" encoding="UTF-8"?> <hello>....</hello>]]>]]>
# Do a fresh installation of Clixon controller on a Debian based system. # Install the required packages sudo apt update sudo apt install -y flex bison git make gcc libnghttp2-dev libssl-dev # Clone the repositories git clone https://github.com/clicon/cligen.git git clone https://github.com/clicon/clixon.git git clone https://github.com/clicon/clixon-controller.git git clone https://github.com/clicon/clixon-pyapi.git # Add the clicon user sudo useradd clicon -N sudo groupadd clicon sudo usermod -a -G clicon `whoami` # Build and install cligen (cd cligen && ./configure && make && sudo make install; ldconfig) # Build and install clixon (cd clixon && ./configure && make && sudo make install; ldconfig) # Build and install clixon-controller (cd clixon-controller && ./configure && make && sudo make install; ldconfig)
For each of the components (Cligen, Clixon, Clixon-controller and Clixon-pyapi) you can build Debian packages with the script build_deb.sh in the scripts/ directory.
The script will create a Debian package in the source directory and should be invoked from the source directory:
$ cd clixon-controller $ ./scripts/build_deb.sh ... $ ls *.deb clixon-controller_1.2.0-1_amd64.deb
The package can be installed with dpkg -i <package> and removed with dpkg -r <package>.
In a typical installation, the main configuration file is in $SYSCONFIG/clixon/controller.xml
(typically: usr/local/share/clixon/controller.xml
). All other directories are declared in this configure file.
Extra config files loaded after the main in alphabetical order are placed in the $SYSCONFIG/clixon/controller/
directory. This is useful for adding and overriding the default config.
The directory structure is as follows:
${SYSCONFIG} (/usr/local/etc) └── clixon ├── controller.xml └── clixon ${DATADIR} (/usr/local/share) ├── clixon └── controller ├── common │ ├── control │ │ └── clixon-controller-config.yang │ └── extensions ├── main │ ├── clixon-controller.yang │ └── ssh-users.yang ├── modules │ ├── __pycache__ │ └── ssh_users.py └── mounts ├── default └── openconfig ${BINDIR} (/usr/local/bin) ├── clixon_cli ├── clixon_netconf └── clixon_server.py ${SBINDIR} (/usr/local/sbin) ├── clixon_backend └── clixon_restconf ${LIBDIR} (/usr/local/lib) └── controller ├── backend │ └── controller_backend.so ├── cli │ └── controller_cli.so └── clispec ├── controller_configure.cli ├── controller_operation.cli └── controller_pipe.cli ${LOCALSTATEDIR} (/usr/local/var) └── controller ├── candidate.d ├── running.d └── startup.dp ${RUNSTATEDIR} (/usr/local/var/run) └── controller ├── controller.pid └── controller.sock