Scroll to navigation

nmstatectl(8) nmstatectl man page nmstatectl(8)

NAME

nmstatectl - 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 version
nmstatectl varlink [UNIX_FILE_SOCKET_PATH]

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.

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 seq

For 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.

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 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.

varlink

Initates the nmstate-varlink service in the specified unix file socket path supporting the libnmstate functions (Show, Apply, Commit and Rollback). This enables functions to be accessed via varlink command-line tool and client implementations. Currently the service is limited to using unix file socket address only.

example: nmstatectl varlink /run/nmstate.so &

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>.

skip the desired network state verification.
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.
all the changes done will be non persistent, they are going to be removed after rebooting.
the user must commit the changes within timeout, or they will be automatically rolled back. Default: 60 seconds.
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>.

SEE ALSO

NetworkManager(8)

May 16, 2023 1.4.4