Commit graph

69 commits

Author SHA1 Message Date
Beniamino Galvani 7a07a0b92d man: replace license blurb with SPDX tag 2023-10-06 13:27:59 +02:00
Thomas Haller ae06a607b3 cli: honor CLICOLOR_FORCE= variable to enable colors with nmcli
Note that [1] suggests to also accept an empty value as having the variable
set. That is likely a bug ([2]) in the documentation, makes little sense, and
is not the case with NO_COLOR ([3]).

[1] https://bixense.com/clicolors/
[2] https://github.com/jhasse/clicolors/issues/13
[3] https://no-color.org/
2023-09-25 09:02:17 +00:00
Thomas Haller 0ac5221c40 cli: fix handling empty NO_COLOR= variable
An empty value NO_COLOR= should not be treated to disable colors.
This is also what [1] says (changed a while ago [2]).

[1] https://no-color.org/
[2] 99f90e27d0
2023-09-25 09:02:17 +00:00
Lubomir Rintel 77508aea59 man/nmcli: document variables affecting fancy output
Notably, PAGER, TERM and NO_COLORS.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1419
2022-10-11 16:34:49 +02:00
Lubomir Rintel 1c17e55627 nmcli/devices: add "checkpoint" command
This is an interface to the Checkpoint/Restore functionality that's
available for quite some time. It runs a command with a checkpoint taken
and rolls back unless success is confirmed before the checkpoint times
out:

  $ nmcli dev checkpoint eth0 -- nmcli dev dis eth0
  Device 'eth0' successfully disconnected.
  Type "Yes" to commit the changes: No
  Checkpoint was removed.

The details about how it's used are documented in nmcli(1) and
nmcli-examples(7).
2022-06-15 12:26:08 +02:00
Lubomir Rintel 6fa1323ce5 nmcli: add --offline option for "add" and "modify"
This adds a global "--offline" option and allows its use with "add" and
"modify" commands. The "add" looks like this:

  $ nmcli --offline conn add type ethernet ens3 ipv4.dns 192.168.1.1 \
      >output.nmconnection

The "modify" is essentially implementing what's been suggested by
Beniamino in bugzilla ticked (referred to below):

  $ nmcli --offline connection modify ens3 ipv4.dns 192.168.1.1 \
      <input.nmconnection >output.nmconnection

Other commands don't support the argument at the moment:

  $ nmcli --offline c up ens3
  Error: 'up' command doesn't support --offline mode.

https://bugzilla.redhat.com/show_bug.cgi?id=1361145
2022-04-19 14:12:42 +02:00
Lubomir Rintel 1aa9c80b9b cli: add "connection migrate" subcommand
This is used to move a connection to a different settings plugin.
2022-03-28 14:59:30 +02:00
Lubomir Rintel cd7687ff60 cli: add color codes for deprecated features
Follow-up commits are going color Wi-Fi networks and connections that rely
on deprecated features differently, to provide a visual cue.

Add color definitions for those.
2022-03-13 18:23:44 +01:00
Lubomir Rintel d3d2e9b508 cli: document connection/device-external colors
These were added without documentation.

Fixes: 16cff1149a ('core: fix taking over external connection after restart')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1137
2022-03-09 14:18:26 +01:00
Thomas Haller a39f7050cc
man/cli: mention nmcli device up|down instead of nmcli device connect|disconnect 2021-07-09 16:41:26 +02:00
Thomas Haller 71f36401da
man/cli: minor cleanups in "nmcli.xml" 2021-07-09 16:04:09 +02:00
Vojtech Bubela 5cd1b2669d
cli: add alias to nmcli device connect|disconnect
nmcli now accepts `nmcli device up|down` which works the same way as
`nmcli device connect|disconnect`

I also edited man pages of nmcli with new options.
2021-07-09 16:01:47 +02:00
Beniamino Galvani 43fc984989 man: document the 'nmcli general reload' command 2021-05-03 22:13:36 +02:00
Fernando Fernandez Mancera cd0cf9229d
veth: add support to configure veth interfaces
NetworkManager is now able to configure veth interfaces throught the
NMSettingVeth. Veth interfaces only have "peer" property.

In order to support Veth interfaces in NetworkManager the design need
to pass the following requirements:

 * Veth setting only has "peer" attribute.
 * Ethernet profiles must be applicable to Veth interfaces.
 * When creating a veth interface, the peer will be managed by
   NetworkManager but will not have a profile.
 * Veth connection can reapply only if the peer has not been modified.
 * In order to modify the veth peer, NetworkManager must deactivate the
   connection and create a new one with peer modified.

In general, it should support the basis of veth interfaces but without
breaking any existing feature or use case. The users that are using veth
interfaces as ethernet should not notice anything changed unless they
specified the veth peer setting.

Creating a Veth interface in NetworkManager is useful even without the
support for namespaces for some use cases, e.g "connecting one side of
the veth to an OVS bridge and the other side to a Linux bridge" this is
done when using OVN kubernetes [1][2]. In addition, it would provide
persistent configuration and rollback support for Veth interfaces.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1885605
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1894139

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2020-11-27 10:12:36 +01:00
Thomas Haller 1a998153b4
man: update supported connection types in man nmcli
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/444
2020-11-17 22:19:35 +01:00
Thomas Haller ed67e01680
man: sort supported connection types in man nmcli 2020-11-17 22:19:29 +01:00
Charlie Getzen e7d2ea95ba
man: update nmcli.xml wording
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/582
2020-07-21 09:14:16 +02:00
Yuri Chornoivan 4e33f8cd89
all: fix minor typos
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/565
2020-07-07 11:33:46 +02:00
Sayed Shah 7337ab8959
all: fix typo in man pages
There should be a comma after 'Otherwise' and 'Currently'.

https://bugzilla.redhat.com/show_bug.cgi?id=1852452

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/560
2020-07-03 10:48:04 +02:00
Thomas Haller a1161781bd
docs: drop "property aliases" section from man nmcli
The aliases are now shown in `man nm-settings-nmcli`. Also the list there
gets generated and isn't hardcoded.
2020-06-12 13:02:02 +02:00
Thomas Haller 2f20878dbf man: fix obsolete references to monitor-connection-files in manual pages
monitor-connection-files was deprecated and disabled by default for a long
time. In the meantime, it has no effect at all.

Remove references from the manual pages.
2020-04-10 15:02:20 +02:00
Beniamino Galvani 2334a27692 cli: support setting removal 2020-03-23 11:42:57 +01:00
Lubomir Rintel 7061341a41 cli: add "nmcli d wifi show"
A quick overview of the currently connected Wi-Fi network, including
credentials. Comes handy if someone wants to connect more devices to
their Hotspot or the same network as they are connected to.
2019-10-18 17:38:57 +02:00
Thomas Haller 597e4b2d1e cli: honor NO_COLOR environment variable to prevent automatic ASCII colors
See-also: https://no-color.org/
2019-10-08 12:18:20 +02:00
Lubomir Rintel 25fadf8f92 cli: add kill switch indication to "nmcli" output
There is some guess work done on the client side. Perhaps the
o.fd.NM.Device could be extended to indicate which kill switch is the
device disabled by. This could be good enough for now though.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/271/commits
2019-09-20 12:49:21 +02:00
Thomas Haller cec39d76bd man/cli: better explain modifying properties regarding +/- modifiers 2019-08-16 08:16:02 +02:00
Thomas Haller a530921f40 man: update reference for reporting bugs in man nmcli
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/188
2019-06-11 13:26:19 +02:00
Rafael Fontenelle d81e10942f all: fix misspellings
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/64
2019-01-24 17:19:44 +01:00
Lubomir Rintel 96782b94e1 merge: branch 'master' of https://github.com/balrog-kun/NetworkManager
https://github.com/NetworkManager/NetworkManager/pull/137
2019-01-04 18:26:41 +01:00
Andrew Zaborowski 3593237527 cli: reuse connections in nmcli dev wifi con
Try to locate an existing connection before creating a new one when
handling "nmcli device wifi connect".  This allows WPA-Enterprise
networks to be activated this way, consistent with the comment that this
command is equivalent to clicking on an SSID in a GUI client.
2018-12-04 14:46:37 +01:00
Lubomir Rintel b385ad0159 all: say Wi-Fi instead of "wifi" or "WiFi"
Correct the spelling across the *entire* tree, including translations,
comments, etc. It's easier that way.

Even the places where it's not exposed to the user, such as tests, so
that we learn how is it spelled correctly.
2018-11-29 17:53:35 +01:00
Thomas Haller 89bd19b0d7 man: fix typo in nmcli manual
Fixes: 17f9801e07
2018-11-14 18:26:07 +01:00
Francesco Giudici 2f2ad4d925 man: add an early reference to nmcli-examples in nmcli man page 2018-11-14 17:15:55 +01:00
Thomas Haller 17f9801e07 man: clarify blocking autoconnect during nmcli connection down
Manually disconnecting a profile of course blocks autoconnect of the
same profile. Otherwise, the profile would likely re-activate right
away, which is clearly against the users intention. If the users just
want to re-activate the profile, they should issue `nmcli connection up`
instead, with does a full down and up cycle.

This is more interesting for profiles that have 'connection.multi-connect'
set to 'multiple'. Would you expect that manually deactivating such a
profile blocks autoconnect of the profile on all devices? Maybe
yes, maybe not. Currently that is indeed the case and autoconnect gets
blocked regardless of multi-connect.
2018-11-13 13:48:10 +01:00
Beniamino Galvani d76ac490f5 cli: sort options in man page and program help
Options are displayed in a random order, sort them.
2018-11-05 09:32:20 +01:00
Thomas Haller 1b732e28f7 man: document nmcli device connect behaviour
Already since 1.0.0 release and commit "3784678177 cli: create a connection
if none exist in 'nmcli dev connect' (rh #1113941)", device-connect can
also create a profile.

That is useful, in particular as opposed to

  $ nmcli connection up ifname "$DEVICE"

which wouldn't create a profile (ever).

Document it.
2018-10-17 18:16:25 +02:00
Lubomir Rintel 29636535b2 client: support 6lowpan setting 2018-06-26 16:21:55 +02:00
Lubomir Rintel 5da77c0e2c client: support wpan setting 2018-06-26 16:21:55 +02:00
Lubomir Rintel 34412a8d3d cli/devices: rescan the Wi-Fi network if the AP list is not fresh enough 2018-06-13 14:48:23 +02:00
Lubomir Rintel bcc9e58bfe cli: allow setting the colors with terminal-colors.d(5)
The present version of the specification is somewhat unclear at times,
Unclear points were discussed with the maintainers [1] and probably
some new version will address those.

https://www.spinics.net/lists/util-linux-ng/msg15222.html

Until then here's how the implementation copes with ambiguities
(after the discussion with util-linux maintainers):

1.) It is unclear whether multiple .schem files should override each
    other or be merged. We use the overriding behavior -- take the
    highest priority one and ignore the rest.

2.) We assume "name.schem" is more specific than "@term.schem".

3.) We assume the "Color name" are to be used as aliases for the color
    sequences and translate them to ANSI escape sequences.

4.) The "Escape sequences" are of no use since the specification
    pretty much assumes an ANSI terminal and none of the sequences make
    any sense in ANSI color codes. We don't support them.
    accept that.

5.) We don't implement TERMINAL_COLORS_DEBUG because it's unspecified
    what should it do.
2018-05-10 14:36:58 +02:00
Beniamino Galvani 3a3f4fb9f7 man: nmcli: add missing aliases 2017-09-13 16:38:34 +02:00
Beniamino Galvani f4aee0c58b man: nmcli: improve description of type, ip4, ip6 aliases
Clarify that the description refers to the alias, not to the property.

https://bugzilla.redhat.com/show_bug.cgi?id=1482772
2017-09-13 16:38:34 +02:00
Beniamino Galvani abcc74e0b5 man: nmcli: grammar fix
s/It's equivalent of/It's equivalent to/
2017-08-30 14:44:26 +02:00
Lubomir Rintel aedeb3cbf4 clients: add support for Bluetooth NAP type 2017-05-31 20:17:42 +02:00
Francesco Giudici f4d0417c8d nmcli: add -g[et-values] option as a '-m tab -t -f <arg>' shortcut
Quick and easy way to get clean and parsable field values.
2017-03-28 10:55:00 +02:00
Beniamino Galvani 4db7890fae cli: support dummy connections 2017-02-22 21:05:04 +01:00
Francesco Giudici 71e172e080 man: minor fix to nmcli.xml 2017-01-09 18:40:21 +01:00
Thomas Haller 207c855348 man: clarify behavior of "ip4"/"ip6" alias to nmcli 2016-11-02 18:31:12 +01:00
Thomas Haller 132234bb79 cli: support qualifying proxy.pac-script with "file://" or "js://" 2016-10-04 11:44:44 +02:00
Thomas Haller c1a4c084b0 cli: support explicitly selecting team-config as file or json data
nmcli has a heuristic when setting the team-config to accepting both
a filename or the plain json text.

Add support for two schemes "file://" and "json://" to explicitly
determine whether to read from file or from json.

Also, no longer silently ignore an all-whitespace word. That is an
error (unless you have a file named " ").

Also, no longer replace newlines with space. Don't mangle the input
text at all.
2016-09-27 10:59:47 +02:00