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

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.

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

See Also

NetworkManager(8)

Info

February 21, 2021 1.0.2 nmstatectl man page