- unstable 2.0.35-1+b1
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 5539bis)
- Call Home (reverse SSH/TLS)
- 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
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¶
help¶
Display list of commands. --(h)elp option is also accepted by all commands to show detailed information about the command.
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
listen¶
Listen for a NETCONF Call Home.
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
disconnect¶
Disconnect from a NETCONF server.
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
cancel-commit¶
Cancel a pending confirmed commit.
cancel-commit [--help] [--persist-id commit-id]
--persist-(i)d commit-id
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
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.
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).
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
--(o)ut file
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
--(o)ut file
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
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
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
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
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]
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
--s(t)ream stream
--(o)ut file
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
remove cert_name
displayown
replaceown cert_path [key_path]
crl¶
Manage Certificate Revocation List certificates that are stored in the ~/.netopeer2-cli/crl directory.
This command is available only with TLS support.
crl [--help] [display] [add crl_path] [remove crl_name]
display
add crl_path
remove crl_name
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
editor¶
Manage the external editor used for modifying raw input data.
editor [--help] [path/name_of_the_editor]
path/name_of_the_editor
status¶
Print information about the current NETCONF session.
user-rpc¶
Send your own content in an RPC envelope.
user-rpc [--help] [--content file] [--out file]
--(c)ontent file
--(o)ut file
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
outputformat¶
Set the format for all the output data. XML is the default.
outputformat (xml | xml_noformat | json)
version¶
Print the CLI version.
verb¶
Set CLI verbosity. Only errors are printed by default.
verb (error/0 | warning/1 | verbose/2 | debug/3)
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
~/.netopeer2-cli/crl
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)
http://tools.ietf.org/html/draft-ietf-netconf-rfc5539bis-05 (NETCONF over TLS)
http://tools.ietf.org/html/draft-ietf-netconf-reverse-ssh-05 (Call Home)
https://github.com/CESNET/netopeer2 (Netopeer homepage)
AUTHORS¶
Michal Vasko <mvasko@cesnet.cz>
Radek Krejci <rkrejci@cesnet.cz>
COPYRIGHT¶
Copyright © 2012-2021 CESNET, a.l.e.
Copyright © 2018-2021 Deutsche Telekom AG.
2021-11-10 | Netopeer |