CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
296 stars 187 forks source link

Steps to set up NetConf server #1445

Open hrmnboparai opened 1 year ago

hrmnboparai commented 1 year ago

Please verify if these are the steps to make my device NetConf server as it will help other newbies like me also

1) Build and install Netopeer2 , Sysrepo and other dependencies. 2) Define YANG model and load them into sysrepo using sysrepoctl. 3) Write a sysrepo plugin that implements the YANG data models and provides necessary callbacks for reading and modifying the configuration and operational data. 4) Configure Netopeer2 to use your Sysrepo plugin as the datastore and NETCONF server backend. 5) Implement RPC callbacks in your Sysrepo plugin to handle NETCONF RPCs defined in your YANG models. When the NETCONF client sends an RPC request, Netopeer2 will invoke the corresponding RPC callback in your Sysrepo plugin to execute the operation.

jktjkt commented 1 year ago

This is all shown in the docs. There are several very different things that are all called "sysrepo plugins"; some of them extend sysrepo's functionality, while other "just" implement some callbacks. Here, you very likely do not need any extended behavior, just something which gets invoked when the running DS is modified, and something which pushes non-config data to operational. You can do that via a plugin for sysrepo-plugind or via a simple standalone application -- as shown on the first page of the documentation.

hrmnboparai commented 1 year ago

I have tried the oven plugin example using sysrepcfg. How can I connect to that plugin using Netopeer2 ?

jktjkt commented 1 year ago

I don't understand the question. Netopeer2 uses sysrepo as its "database". Here, sysrepo acts as a "YANG database backend" and Netopeer2 acts as something which processes NETCONF requests on top of sysrepo. So whatever modules/callbacks/plugins you have active in sysrepo, they are also made available over the NETCONF protocol via Netopeer2.

I encourage you to (re)read the documentation, starting at the sysrepo homepage, continuing with an overview on how to write applications/plugins, and then reviewing the READMEs and documentation of all related projects. After you've done that and if you still have questions related to basic sysrepo/netopeer2 functionality, please clarify what steps you have tried, what behavior you see, and what functionality you're looking for.