nmstatectl - Man Page
A nmstate command line tool
Synopsis
nmstatectl show [INTERFACE_NAME] [--json]
nmstatectl show [-r, --running-config]
nmstatectl set STATE_FILE_PATH [Options]
nmstatectl apply STATE_FILE_PATH [Options]
nmstatectl edit [INTERFACE_NAME] [Options]
nmstatectl gc [STATE_FILE_PATH] [Options]
nmstatectl rollback [CHECKPOINT_PATH]
nmstatectl commit [CHECKPOINT_PATH]
nmstatectl service [-c, --config <CONFIG_FOLDER>]
nmstatectl statistic STATE_FILE_PATH [-c, --current <CURRENT_STATE_FILE>]
nmstatectl version
Description
nmstatectl is created for users who want to try out nmstate without using libnmstate.
- show
Query the current network state. YAML is the default output format. Use the --json argument to change the output format to JSON. To limit the output state to include certain interfaces only, please specify the interface name. Please be advised, global config like DNS will be included. nmstatectl s is an aliased command for nmstatectl show.
For multiple interface names, use comma to separate them. You can also use patterns for interface names:
* matches everything
? matches any single character
[seq] matches any character in seq
[!seq] matches any character not in seqFor example, to show all interfaces starts with eth:
nmstatectl show eth\*
# The backslash is required to stop shell expanding '*' to file names.
set
"Set" command is deprecated. Please consider using "apply" instead.
Apply the network state from specified file in YAML or JSON format. By default, if the network state after state applied is not identical to the desired state, nmstatectl rollbacks to the state before set command. Use the --no-verify argument to skip the verification.
- apply
Apply the network state from specified file in YAML or JSON format. By default, if the network state after state applied is not identical to the desired state, nmstatectl rollbacks to the state before set command. Use the --no-verify argument to skip the verification. nmstatectl a is an aliased command for nmstatectl apply.
- edit
nmstatectl will invoke the text editor defined by environment variable EDITOR for editing the network state in YAML format. Once the text editor quit, nmstatectl will try to apply it using "nmstatectl set".
If there is any syntax error, you will be asked to edit again. Multiple interfaces are supported, check show for detail.By default, if the network state after state applied is not identical to the desired state, nmstatectl rollbacks to the state before edit command. Use the --no-verify argument to skip the verification.
nmstatectl supports manual transaction control which allows user to decide whether rollback to previous (before "nmstatectl set/edit") state.
- rollback
rollback the network state from specified checkpoint file. nmstatectl will take the latest checkpoint if not defined as argument.
- gc
Generates configuration files for specified network state file(s). The output will be dictinary with plugin name as key and an tuple as value. The tuple will holding configuration file name and configuration content.
The generated configuration is not saved into system, users have to do it by themselves after refering to the network backend.
- commit
commit the current network state. nmstatectl will take the latest checkpoint if not defined as argument.
- version
displays nmstate version.
- service
Apply all network state files ending with .yml in specified( default: /etc/nmstate) folder. Please refer to manpage nmstate.service(8) for detail.
- statistic
Generate statistic for specified network state files. Multiple desire states files are supported. The --current <CURRENT_STATE_FILE> argument could instruct nmstate to read current network state from specified file instead of querying current host.
Options
- --json
change the output format to JSON.
- -r, ā--running-config
Showing the running network configuration.
- -s, ā--show-secrets
Showing with the secrets. By default, nmstate is masking the passwords by <_password_hid_by_nmstate>.
- --no-verify
skip the desired network state verification.
- --no-commit
create a checkpoint which later could be used for rollback or commit. The checkpoint will be the last line of nmstatectl output, example: /org/freedesktop/NetworkManager/Checkpoint/1.
- --memory-only
all the changes done will be non persistent, they are going to be removed after rebooting.
- --timeout=<TIMEOUT>
the user must commit the changes within timeout, or they will be automatically rolled back. Default: 60 seconds.
- --version
displays nmstate version.
Limitations
* Maximum supported number of interfaces in a single desire state is 1000.
Bug Reports
Report bugs on nmstate GitHub issues <https://github.com/nmstate/nmstate>.
Copyright
License LGPL-2.1 or any later version <https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt>.