forked from FRRouting/frr
-
Notifications
You must be signed in to change notification settings - Fork 13
Plugins: Sysrepo
Renato Westphal edited this page Aug 21, 2019
·
4 revisions
# apt-get install git cmake build-essential bison flex libpcre3-dev libev-dev \
libavl-dev libprotobuf-c-dev protobuf-c-compiler libcmocka0 \
libcmocka-dev doxygen libssl-dev libssl-dev libssh-dev
# apt-get install libyang0.16 libyang-dev
$ git clone https://github.com/sysrepo/sysrepo.git
$ cd sysrepo/
$ mkdir build; cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DGEN_LANGUAGE_BINDINGS=OFF .. && make
# make install
$ git clone https://github.com/CESNET/libnetconf2.git
$ cd libnetconf2/
$ mkdir build; cd build
$ cmake .. && make
# make install
$ git clone https://github.com/CESNET/Netopeer2.git
$ cd Netopeer2
$ cd server
$ mkdir build; cd build
$ cmake .. && make
# make install
Build and install FRR using the --enable-sysrepo
configure-time option.
Install the FRR YANG modules in the Sysrepo datastore:
# sysrepoctl --install --yang=/usr/local/share/yang/frr-interface.yang
# sysrepoctl --install --yang=/usr/local/share/yang/frr-isisd.yang
Start sysrepod and netopeer2-server
# sysrepod -l 1 -d &
# netopeer2-server -d &
Start the FRR daemons with the sysrepo module:
# isisd -M sysrepo --log=stdout
The following NETCONF scripts can be used to show and edit the FRR configuration: https://github.com/rzalamena/ietf-hackathon-brazil-201907/tree/master/netconf-scripts
Example:
# ./netconf-edit.py 127.0.0.1
# ./netconf-get-config.py 127.0.0.1
<?xml version="1.0" encoding="UTF-8"?><data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"><isis xmlns="http://frrouting.org/yang/isisd"><instance><area-tag>testnet</area-tag><is-type>level-1</is-type></instance></isis></data>
NOTE: the ncclient library needs to be installed first:
apt install -y python3-ncclient
The sysrepocfg can also be used to show/edit the FRR configuration. Example:
# sysrepocfg --format=json --import=frr-isisd.json --datastore=running frr-isisd
# sysrepocfg --format=json --export --datastore=running frr-isisd
{
"frr-isisd:isis": {
"instance": [
{
"area-tag": "testnet",
"is-type": "level-1"
}
]
}
}