for (eg cli_commitv). See clixon_cli_api.h for new names. Use restconf format for internal xmldb keys. Eg /a/b=3,4 Changed example to use multiple cli callbacks
51 lines
1.6 KiB
Text
51 lines
1.6 KiB
Text
Clixon yang routing example
|
|
+++++++++++++++++++++++++++
|
|
|
|
0. Compile and run
|
|
------------------
|
|
cd example
|
|
make && sudo make install
|
|
# Start backend
|
|
clixon_backend -f /usr/local/etc/routing.conf -I
|
|
# Edit cli
|
|
clixon_cli -f /usr/local/etc/routing.conf
|
|
# Send netconf command
|
|
clixon_netconf -f /usr/local/etc/routing.conf
|
|
|
|
1. Setting data example using netconf
|
|
-------------------------------------
|
|
|
|
<rpc><edit-config><target><candidate/></target><config>
|
|
<interfaces>
|
|
<interface>
|
|
<name>eth1</name>
|
|
<enabled>true</enabled>
|
|
<ipv4>
|
|
<address>
|
|
<ip>9.2.3.4</ip>
|
|
<prefix-length>24</prefix-length>
|
|
</address>
|
|
</ipv4>
|
|
</interface>
|
|
</interfaces>
|
|
</config></edit-config></rpc>]]>]]>
|
|
|
|
2. Getting data using netconf
|
|
-----------------------------
|
|
|
|
<rpc><get-config><source><candidate/></source></get-config></rpc>]]>]]>
|
|
|
|
<rpc><get-config><source><candidate/></source><filter/></get-config></rpc>]]>]]>
|
|
|
|
<rpc><get-config><source><candidate/></source><filter type="xpath"/></get-config></rpc>]]>]]>
|
|
|
|
<rpc><get-config><source><candidate/></source><filter type="subtree"><configuration><interfaces><interface><ipv4/></interface></interfaces></configuration></filter></get-config></rpc>]]>]]>
|
|
|
|
<rpc><get-config><source><candidate/></source><filter type="xpath" select="/interfaces/interface/ipv4"/></get-config></rpc>]]>]]>
|
|
|
|
<rpc><validate><source><candidate/></source></validate></rpc>]]>]]>
|
|
|
|
3. Run as docker container
|
|
--------------------------
|
|
cd docker
|
|
# look in README
|