netopeer2-cli(1)
| netopeer2-cli(1) | General Commands Manual | netopeer2-cli(1) |
NAME
netopeer2-cli - NETCONF client with command line interface build on libnetconf2
DESCRIPTION
netopeer2-cli serves as a generic NETCONF client providing a simple interactive command line interface. It allows user to establish a NETCONF session with a NETCONF-enabled device on the network and to obtain and manipulate its configuration data. netopeer2-cli is limited to a single NETCONF connection at a time via a forward or a reverse (Call Home) connecting method.
Here is the list of NETCONF capabilities supported by netopeer2-cli:
- NETCONF protocol version 1.0 and 1.1 (RFC 6241)
- SSH transport (RFC 6242)
- TLS transport (RFC 7589)
- Call Home (RFC 8071)
- Event Notifications (RFC 5277)
- Access Control (RFC 6536)
- :writable-running capability
- :startup capability
- :candidate capability
- :confirmed-commit capability
- :validate capability version 1.1
- :with-defaults capability (RFC 6243)
- :url capability
- :xpath capability
- NMDA operations (RFC 8526)
- YANG Schema Mount (RFC 8528)
- YANG notification subscriptions (RFC 8639)
- YANG Push subscriptions (RFC 8641)
TRANSPORT
The supported transport protocols are detected automatically based on how was libnetconf2 compiled. Unsupported (sub)commands are then not available and are hidden in the help. This page, however, contains them all.
COMMANDS
auth
Manage SSH authentication options - authentication preferences and private keys.
This command is available with SSH support.
auth (--help | pref [(publickey | interactive | password) preference] | keys [add private_key_path] [remove key_index])
pref
preference
keys
path_to_the_key
remove cert_name
displayown
replaceown cert_path [key_path]
cancel-commit
Cancel a pending confirmed commit.
cancel-commit [--help] [--persist-id commit-id]
--persist-(i)d commit-id
cert
Manage client and trusted Certificate Authority certificates that are used for TLS verification stored in ~/.netopeer2-cli/client.* and ~/.netopeer2-cli/certs respectively.
This command is available with TLS support.
cert [--help] [display] [add cert_path] [remove cert_name] [displayown] [replaceown (cert_path.pem | cert_path.crt key_path.key)]
display
add cert_path
commit
Perform NETCONF <commit> operation. For more details see RFC 6241 section 8.3.4.1.
commit [--help] [--confirmed] [--confirm-timeout sec] [--persist new-commit-id] [--persist-id commit-id]
--(c)onfirmed
--confirm-(t)imeout sec
--(p)ersist new-commit-id
--persist-(i)d commit-id
connect
Connect to a NETCONF server.
connect [--help] [--host hostname] [--port
num]
[--ssh] [--login username]
--tls [--cert cert_path [--key key_path]] [--trusted
trusted_CA_store.pem]
--h(o)st hostname
--(p)ort num
--(s)sh
--(l)ogin username
--(t)ls
--(c)ert cert_path
--(k)ey key_path
--t(r)usted trusted_CA_store.pem
copy-config
Perform NETCONF <copy-config> operation. For more details see RFC 6241 section 7.3.
copy-config [--help] --target running|startup|candidate|url:url (--source running|startup|candidate|url:url | --src-config [file]) [--defaults report-all|report-all-tagged|trim|explicit]
--(t)arget running|startup|candidate|url:url
--(s)ource running|startup|candidate|url:url
--src-(c)onfig [file]
--(d)efaults report-all|report-all-tagged|trim|explicit
delete-config
Perform NETCONF <delete-config> operation. For more details see RFC 6241 section 7.4.
delete-config [--help] --target startup|url:url
--(t)arget startup|url:url
delete-sub
Perform YANG notifications <delete-subscription> operation. For more details see RFC 8639 section 2.4.4..
delete-sub [--help] --id <sub-ID> [--out <file>] [--rpc-timeout <seconds>]
--(i)d sub-ID
discard-changes
Perform NETCONF <discard-changes> operation. It reverts the candidate configuration to the current running configuration. For more details see RFC 6241 section 8.3.4.2.
disconnect
Disconnect from a NETCONF server.
edit-config
Perform NETCONF <edit-config> operation. For more details see RFC 6241 section 7.2.
edit-config [--help] --target running|candidate (--config [file] | --url url) [--defop merge|replace|none] [--test set|test-only|test-then-set] [--error stop|continue|rollback]
--(t)arget running|candidate
--(c)onfig [file]
--(u)rl ur
--def(o)p merge|replace|none
- merge
- Merge configuration data at the corresponding level. This is the default value.
- replace
- Edit configuration data completely replaces the configuration in the target datastore.
- none
- The target datastore is unaffected by the edit configuration data, unless and until the edit configuration data contains the operation attribute to request a different operation.
--t(e)st set|test-only|test-then-set
- set
- Do not perform validation test.
- test-only
- Do not apply the modified data, only perform the validation test.
- test-then-set
- Perform a validation test before attempting to apply modified configuration data. This is the default value.
--e(r)ror stop|continue|rollback
- stop
- Abort the operation on first error. This is the default value.
- continue
- Continue to process configuration data on error. The error is recorded and negative response is returned.
- rollback
- Stop the operation processing on error and restore the configuration to its complete state at the start of this operation. This action is available only if the server supports :rollback-on-error capability (see RFC 6241 section 8.5).
edit-data
Perform NMDA <edit-data> operation. For more details see RFC 8526 section 3.1.2..
edit-data [--help] --datastore running|startup|candidate (--config[=<file>] | --url <url>) [--defop merge|replace|none] [--rpc-timeout <seconds>]
--(d)atastore running|startup|candidate
--(c)onfig [file]
--(u)rl ur
--def(o)p merge|replace|none
- merge
- Merge configuration data at the corresponding level. This is the default value.
- replace
- Edit configuration data completely replaces the configuration in the target datastore.
- none
- The target datastore is unaffected by the edit configuration data, unless and until the edit configuration data contains the operation attribute to request a different operation.
editor
Manage the external editor used for modifying raw input data.
editor [--help] [path/name_of_the_editor]
path/name_of_the_editor
establish-push
Perform YANG push <establish-subscription> operation. Must be either periodic or on-change. For more details see RFC 8641 section 4.4.1..
establish-push [--help] --datastore running|startup|candidate|operational [--filter-subtree[=<file>] | --filter-xpath <XPath> | --filter-ref <name>] [--end <time>] [--encoding <encoding>] (--periodic --period <period> [--anchor-time <time>] | --on-change [--dampening-period <period>] [--no-sync-on-start] [--excluded-change <change>]*) [--out <file>] [--rpc-timeout <seconds>]
--(d)atastore running|startup|candidate|operational
--filter-(s)ubtree [file]
--filter-(x)path XPath
--filter-(r)ef name
--(e)nd time
- +time
- Current time plus the given number of seconds.
- time
- Absolute time as number of seconds since 1970-01-01.
- -time
- Current time minus the given number of seconds.
--(e)ncoding encoding
--period period
--anchor-time time
--dampening-period period
--no-sync-on-start
--excluded-change change
establish-sub
Perform YANG notifications <establish-subscription> operation. For more details see RFC 8639 section 2.4.2..
establish-sub [--help] --stream <stream> [--filter-subtree[=<file>] | --filter-xpath <XPath> | --filter-ref <name>] [--begin <time>] [--end <time>] [--encoding <encoding>] [--out <file>] [--rpc-timeout <seconds>]
--s(t)ream stream
--filter-(s)ubtree [file]
--filter-(x)path XPath
--filter-(r)ef name
--(b)egin time
--(e)nd time
- +time
- Current time plus the given number of seconds.
- time
- Absolute time as number of seconds since 1970-01-01.
- -time
- Current time minus the given number of seconds.
--(e)ncoding encoding
exit
Quit the program.
get
Perform NETCONF <get> operation. Retrieves both status as well as configuration data from the current running datastore. For more details see RFC 6241 section 7.7.
get [--help] [--filter-subtree [file] | --filter-xpath XPath] [--defaults report-all|report-all-tagged|trim|explicit] [--out file]
--filter-(s)ubtree [file]
--filter-(x)path XPath
--(d)efaults report-all|report-all-tagged|trim|explicit
get-config
Perform NETCONF <get-config> operation. Retrieves only configuration data from the specified source. For more details see RFC 6241 section 7.1.
get-config [--help] --source running|startup|candidate [--filter-subtree [file] | --filter-xpath XPath] [--defaults report-all|report-all-tagged|trim|explicit] [--out file]
--(s)ource running|startup|candidate
--filter-(s)ubtree [file]
--filter-(x)path XPath
--(d)efaults report-all|report-all-tagged|trim|explicit
get-data
Perform NMDA <get-data> operation. For more details see RFC 8526 section 3.1.1..
get-data [--help] --datastore running|startup|candidate|operational [--filter-subtree[=<file>] | --filter-xpath <XPath>] [--config true|false] [--origin <origin>]* [--negated-origin] [--depth <subtree-depth>] [--with-origin] [--defaults report-all|report-all-tagged|trim|explicit] [--out <file>] [--rpc-timeout <seconds>]
--(d)atastore running|startup|candidate|operational
--filter-(s)ubtree [file]
--filter-(x)path XPath
--(c)onfig true|false
--(O)rigin origin
--(n)egated-origin
--d(e)pth subtree-depth
--(w)ith-origin
--de(f)aults report-all|report-all-tagged|trim|explicit
get-schema
Perform NETCONF <get-schema> operation that retrieves specified data model used by the server. This operation is available only if the server implements the YANG Module for NETCONF Monitoring. The list of available schemas can be retrieved from /netconf-state/schemas subtree via the <get> operation. For more details see RFC 6022 sections 3.1 and 4.
get-schema [--help] --model identifier [--version version] [--format format] [--out file]
--(m)odel identifier
--(v)ersion version
--(f)ormat format
--(o)ut file
help
Display list of commands. --(h)elp option is also accepted by all commands to show detailed information about the command.
kill-session
Perform NETCONF <kill-session> operation to terminate specified NETCONF session. To terminate the current session, use the disconnect command. For more details see RFC 6241 section 7.9.
kill-session [--help] --sid sesion-ID
--(s)id session-ID
kill-sub
Perform YANG notifications <kill-subscription> operation. For more details see RFC 8639 section 2.4.5..
kill-sub [--help] --id <sub-ID> [--out <file>] [--rpc-timeout <seconds>]
--(i)d sub-ID
knownhosts
Manage the user knownhosts file where all the known SSH server host keys are stored.
knownhosts (--help | --del <key_index> | --mode <accept|accept-new|ask|skip|strict>)
--(d)el key_index
--(m)ode accept|accept-new|ask|skip|strict
- accept
- Add the host key to the knownhosts file without prompting and allow connections to servers that changed their host key.
- accept-new
- Add the host key to the knownhosts file without prompting, but only if it is not already there.
- ask
- Prompt the user to accept the host key. This is the default mode.
- skip
- Skip the host key and do not add it to the knownhosts file.
- strict
- Do not add the host key to the knownhosts file and refuse to connect to hosts whose host key is not known or has changed.
listen
Listen for a NETCONF Call Home connection.
listen [--help] [--timeout sec] [--host hostname] [--port num] [--ssh] [--login username] --tls [--cert cert_path [--key key_path]] [--trusted trusted_CA_store.pem]
--t(i)meout sec
--h(o)st hostname
other options
lock
Perform the NETCONF <lock> operation to lock the entire configuration datastore of a server. For more details see RFC 6241 section 7.5.
lock [--help] --target running|startup|candidate
--(t)arget running|startup|candidate
modify-push
Perform YANG push <modify-subscription> operation. For more details see RFC 8641 section 4.4.2..
modify-push [--help] --id <sub-ID> --datastore running|startup|candidate|operational [--filter-subtree[=<file>] | --filter-xpath <XPath> | --filter-ref <name>] [--end <time>] (--periodic --period <period> [--anchor-time <time>] |--on-change [--dampening-period <period>]) [--out <file>] [--rpc-timeout <seconds>]
--(I)d sub-ID
--(d)atastore running|startup|candidate|operational
--filter-(s)ubtree [file]
--filter-(x)path XPath
--(f)ilter-ref name
--(e)nd time
--per(i)od period
--(a)nchor-time time
--da(m)pening-period period
modify-sub
Perform YANG notifications <modify-subscription> operation. For more details see RFC 8639 section 2.4.3..
modify-sub [--help] --id <sub-ID> [--filter-subtree[=<file>] | --filter-xpath <XPath> | --filter-ref <name>] [--end <time>] [--out <file>] [--rpc-timeout <seconds>]
--(i)d sub-ID
--filter-(s)ubtree [file]
--filter-(x)path XPath
--(f)ilter-ref name
--(e)nd time
- +time
- Current time plus the given number of seconds.
- time
- Absolute time as number of seconds since 1970-01-01.
- -time
- Current time minus the given number of seconds.
monitor
Monitor the client connection status.
monitor [--help] [on | off]
outputformat
Set the format for all the output data. XML is the default.
outputformat (xml | xml_noformat | json)
resync-sub
Perform YANG push <resync-subscription> operation. For more details see RFC 8641 section 4.4.4..
resync-sub [--help] --id <sub-ID> [--out <file>] [--rpc-timeout <seconds>]
--(i)d sub-ID
searchpath
Set the directory, which will be used when searching for modules. Modules are always needed to be able to work with the same data as a NETCONF server. They are searched locally (in this directory) only if the server does not support the <get-schema> NETCONF operation. If it does, all the modules (except ietf-netconf-monitoring, which includes the definition of the <get-schema> RPC itself) are downloaded from the server.
searchpath model-dir-path
status
Print information about the current NETCONF session.
subscribe
Perform NETCONF Event Notifications <create-subscription> operation. For more details see RFC 5277 section 2.1.1.
subscribe [--help] [--filter-subtree [file] | --filter-xpath XPath] [--begin time] [--end time] [--stream stream] [--out file]
--filter-(s)ubtree [file]
--filter-(x)path XPath
--(b)egin time
--(e)nd time
- +time
- Current time plus the given number of seconds.
- time
- Absolute time as number of seconds since 1970-01-01.
- -time
- Current time minus the given number of seconds.
--s(t)ream stream
timed
Time all the commands (that communicate with a server) from issuing an RPC to getting a reply.
timed [--help] on|off
unlock
Perform the NETCONF <unlock> operation to release a configuration lock, previously obtained with the <lock> operation. For more details see RFC 6241 section 7.6.
lock [--help] --target running|startup|candidate
--(t)arget running|startup|candidate
user-rpc
Send your own content in an RPC envelope.
user-rpc [--help] [--content file] [--out file]
--(c)ontent file
--(o)ut file
validate
Perform the NETCONF <validate> operation to validate configuration data. For more details see RFC 6241 section 8.6.4.1.
validate [--help] (--source running|startup|candidate|url:url | --src-config [file])
--(s)ource running|startup|candidate|url:url
--src-(c)onfig [file]
verb
Set CLI verbosity. Only errors are printed by default.
verb (error/0 | warning/1 | verbose/2 | debug/3)
version
Print the CLI version.
?
Display list of commands. --(h)elp option is also accepted by all commands to show detailed information about the command.
quit
Quit the program.
FILES
~/.netopeer2-cli/config.xml
~/.netopeer2-cli/history
~/.netopeer2-cli/client.pem
~/.netopeer2-cli/client.crt
~/.netopeer2-cli/client.key
~/.netopeer2-cli/certs
SEE ALSO
RFC 5277 (Event Notifications)
RFC 6241 (NETCONF v1.1)
RFC 6242 (NETCONF over SSH)
RFC 6243 (With-defaults capability)
RFC 6536 (NETCONF Access Control)
RFC 7589 (NETCONF over TLS)
RFC 8071 (Call Home)
RFC 8526 (NMDA operations)
RFC 8528 (YANG Schema Mount)
RFC 8639 (YANG notification subscriptions)
RFC 8641 (YANG Push subscriptions)
https://github.com/CESNET/netopeer2 (Netopeer homepage)
AUTHORS
Michal Vasko <mvasko@cesnet.cz>
Radek Krejci <rkrejci@cesnet.cz>
COPYRIGHT
Copyright © 2012-2022 CESNET, a.l.e.
Copyright © 2018-2022 Deutsche Telekom AG.
| 2022-11-25 | Netopeer |
