diff --git a/man/nmcli.xml b/man/nmcli.xml
index 5c6d6d3e78..9f2f84273a 100644
--- a/man/nmcli.xml
+++ b/man/nmcli.xml
@@ -1436,15 +1436,23 @@
+ --permanent
yes
no
+ up
+ down
Set device properties.
+
+ The property accepts a
+ option to persist the managed state to disk, and not only in runtime. The special
+ values and can be used to set the administrative
+ state of the device at the same time as the managed state.
diff --git a/src/nmcli/devices.c b/src/nmcli/devices.c
index 35ed5b6fd1..1547bd2ebf 100644
--- a/src/nmcli/devices.c
+++ b/src/nmcli/devices.c
@@ -855,7 +855,7 @@ usage(void)
"delete | monitor | wifi | lldp }\n\n"
" status\n\n"
" show []\n\n"
- " set [ifname] [autoconnect yes|no] [managed yes|no]\n\n"
+ " set [ifname] [autoconnect yes|no] [managed [--permanent] yes|no|up|down]\n\n"
" connect \n\n"
" reapply \n\n"
" modify ([+|-]. )+\n\n"
@@ -978,7 +978,7 @@ usage_device_set(void)
"ARGUMENTS := DEVICE { PROPERTY [ PROPERTY ... ] }\n"
"DEVICE := [ifname] \n"
"PROPERTY := { autoconnect { yes | no } |\n"
- " { managed { yes | no }\n"
+ " { managed [--permanent] { yes | no | up | down }\n"
"\n"
"Modify device properties.\n\n"));
}
@@ -2878,13 +2878,22 @@ do_device_set(const NMCCommand *cmd, NmCli *nmc, int argc, const char *const *ar
}
if (argc == 1 && nmc->complete) {
- if (**argv == '-')
- nmc_complete_strings(*argv, "--permanent");
- else
- nmc_complete_bool(*argv);
+ nmc_complete_strings(*argv,
+ "true",
+ "yes",
+ "on",
+ "false",
+ "no",
+ "off",
+ "up",
+ "down",
+ "--permanent");
}
- if (!nmc_string_to_bool(*argv, &val, &error)) {
+ if (matches(*argv, "up") || matches(*argv, "down")) {
+ flags |= NM_DEVICE_MANAGED_FLAGS_SET_ADMIN_STATE;
+ val = matches(*argv, "up") ? TRUE : FALSE;
+ } else if (!nmc_string_to_bool(*argv, &val, &error)) {
g_string_printf(nmc->return_text, _("Error: 'managed': %s."), error->message);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
return;