Commit Graph

324 Commits

Author SHA1 Message Date
Thomas Haller
96a7f3a3ba logging: make use of journal configurable 2015-07-14 15:55:14 +02:00
Lubomir Rintel
1375d9c13a cli: add master option to "nmcli c add" 2015-07-12 15:46:37 +02:00
Thomas Haller
947fc9a278 config: add write support for NMConfig
Internal configuration is written as keyfile to
NMSTATEDIR"/NetworkManager-intern.conf"

Basically, the content of this file is merged with user
configuration from "NetworkManager.conf" files. After loading
the configuration, NMConfig exposes a merged view of user-provided
settings and internal overwrites.

All sections/groups named [.intern*] are reserved for internal
configuration values. They can be written by API, but are ignored
when the user sets them via "NetworkManager.conf". For these
internal sections, no conflicts can arise.

We can also overwrite individual properties from user configuration.
In this case, we store the value we want to set, but also remember
the value that the user configuration had, at the time of setting.
If on a later reload the user configuration changed, we ignore our
internal value -- as we assume that the user modified the value
afterwards.
We can also hide/delete value from user configuration.
This works on a per-setting basis.
2015-07-02 16:01:20 +02:00
Thomas Haller
6f0036151f settings: enable "ibft" plugin by default together with "ifcfg-rh"
Originally, ibft settings were handled by "ifcfg-rh" plugin. Later, we added
a separate "ibft" plugin and moved the functionality there.

The problem was that users quite possibly had a configuration like
  [main]
  plugins=ifcfg-rh
in their "NetworkManager.conf". That meant, after upgrade users would
no longer have ibft support.

We fixed that by installing "/etc/NetworkManager/conf.d/10-ibft-plugin.conf"
which was read after the main file and contained:
  [main]
  plugins+=ibft

We no longer want to install configuration snippets with our core packages to
/etc. Avoid the regression by changing the meaning of "ifcfg-rh". By enabling
"ifcfg-rh" you now implicitly enable "ibft" plugin as well. This can be
turned off via "no-ibft". And you can continue to enable "ibft" plugin
alone.
2015-07-02 16:01:20 +02:00
Thomas Haller
d783742b22 config: read configuration directory "/usr/lib/NetworkManager/conf.d"
This allows packages to install their configuration snippets to
"/usr/", which is a better place for system-provided configuration
files then "/etc".

"/usr/lib/NetworkManager/conf.d/" is read first, so that the values
in /etc have higher priority.

In general, we want to move system-provided configuration away from
/etc, so that a user can do a "factory-reset" by purging /etc.

https://bugzilla.gnome.org/show_bug.cgi?id=738853
2015-07-02 16:01:20 +02:00
Thomas Haller
fab5c6a372 config: refactor processing of 'option+' and 'option-' config settings
We have a hack to extend GKeyFile to support specifying an 'option+'
key. Also add support for 'option-'.

Options that make use of these modifiers can only be string lists.
So do the concatenation not based on plain strings, but by treating
the values as string lists. Also, don't add duplicates.
2015-07-02 15:50:03 +02:00
Thomas Haller
f8c9863d55 config: fix order of processing [connection] sections in NMConfig
We support the "NetworkManager.conf" sections '[connection]' and
'[connection.\+]' (with arbitrary suffix).

Fix the order of how we evaluate these section.

Note that the literal '[connection]' section is always evaluated lastly
after any other '[connection.\+]' section.

Within one file, we want to evaluate the sections in top-to-bottom
order. But accross multiple files, we want to order them
later-files-first. That gives a reasonable behavior if the user
looks at one file, and also if he wants to overwrite configuration
via configuration snippets like "conf.d/99-last.conf".

Note that if a later file extends/overwrites a section defined in an
earlier file, the section is still considered with lower priority
This is intentional, because the user ~extends~ a lower priority
section. If he wants to add a higher priority section, he should
choose a new suffix.

Fixes: dc0193ac02
2015-07-02 15:50:03 +02:00
Lubomir Rintel
b3e57cf3ca cli: allow specifying arbitrary properties on "nmcli c add"
Syntax: nmcli c add ... -- [+|-]<setting>.<property> <value> ...
2015-07-02 09:33:58 +02:00
Jiří Klimeš
f05d41d358 man: mention that connection.autoconnect-slaves property supports default value 2015-06-19 09:32:58 +02:00
Beniamino Galvani
4739ff6e7c settings: remove ifcfg-suse plugin
After the hostname functionality has been moved from plugins to core,
the ifcfg-suse plugin contains only boilerplate code with no actual
functionality.

Remove the plugin, mark it as deprecated in manual page and print a
warning when it is selected in configuration file.
2015-06-12 15:59:39 +02:00
Beniamino Galvani
d385a2a57a settings: remove hostname handling from plugins
Remove all hostname-related code from plugins since this functionality
has been moved to the core.
2015-06-12 15:59:39 +02:00
Thomas Haller
f3c61f8141 device: remove reading ipv6 privacy setting from sysctl
Since introduction for support of ip6-privacy (use_tempaddr,
RFC4941) with commit d376270bfe,
the sysctl value from /etc was always read first.

This is problematic, because an explicit setting in the
connection should not be ignored over a global configuration.

Drop that old behavior. It was also problematic, because we did
not read any files under /etc/sysctl.d (except for sysctl.conf).
Also, we did not honor per-interface configurations.

Now we also use as last fallback the value from
/proc/sys/net/ipv6/conf/default/use_tempaddr
That has the advantage of falling back to the system default value
so that NM doesn't need to have it's own default policy
(Related: https://bugzilla.redhat.com/show_bug.cgi?id=1187525).

This is a change in behavior.
2015-06-05 12:38:30 +02:00
Thomas Haller
e729dd70ae device: add global configuration default for ip6-privacy (use_tempaddr, RFC4941)
Support default value for setting 'ipv6.ip6-privacy' in
NetworkManager.conf.

If the global value is unset, preserve old behavior of looking into
/etc/sycctl.conf first. That behavior was introduced with commit
d376270bfe, since we support ip6-privacy
setting.

If the global value is set to "unknown", add a new fallback
that instead reads the runtime value from
  "/proc/sys/net/ipv6/conf/default/use_tempaddr"
This seems more sensible behavior because we fallback to sysctl,
but instead of looking at static files in /etc, read /proc.
But to preserve the old behavior, we only do that when a global
value is configured at all.

https://bugzilla.gnome.org/show_bug.cgi?id=721200
2015-06-05 12:38:30 +02:00
Thomas Haller
59a991725a device: make route-metric configurable per-device
The route-metric can be configured per connection via the
ipv4.route-metric and ipv6.route-metric fields. When the
value is left at -1 (the default), we would determine the
route-metric based on the device type (nm_device_get_priority()).

Extend that scheme by making the default value overwritable in
NetworkManager.conf.
2015-06-05 12:38:30 +02:00
Thomas Haller
dc0193ac02 config: support a [connection] section to NetworkManager.conf to specify connection defaults
Add support for a new section [connection] in NetworkManager.conf.
If the connection leaves an option at "unknown"/"default", we can
support overwriting the value from global configuration.

We also support other sections that are named with "connection"
as a prefix, such as [connection2], [connection-wifi]. This is
to support multiple default values that can be applied depending
on the used device.

I think this has great potential. Only downside is that when
the user looks at a connection value, it will see that it is
unspecified. But the actually used value depends on the device
type and might not be obvious.

https://bugzilla.gnome.org/show_bug.cgi?id=695383
https://bugzilla.redhat.com/show_bug.cgi?id=1164677
2015-06-05 12:38:29 +02:00
Thomas Haller
3fb60edf9f device: add device-spec "type:"
Support a device-spec to match by device-type.
This matches on the value as shown by

  nmcli -f GENERAL.TYPE device show
2015-06-05 12:38:29 +02:00
Beniamino Galvani
3bc097b084 device: don't assume by default IPv6LL-only connections
Add the new configuration option 'assume-ipv6ll-only' which specifies
the devices for which NM will try to assume an existing IPv6LL-only
configuration.

The new default behavior is to ignore such configurations since IPv6LL
addresses are automatically assigned by the kernel when the device is
brought up and thus the presence of an IPv6LL address doesn't mean
that the device was configured by the administrator.

The previous behavior was to always assume IPv6LL-only configurations
but this often had the unwanted effect of preventing other on-disk
configurations to be activated. To preserve the old behavior the
option must be set to '*'.

https://bugzilla.redhat.com/show_bug.cgi?id=1138426
2015-06-02 14:04:54 +02:00
Beniamino Galvani
c029502912 ipv4ll: use internal implementation 2015-05-11 10:48:48 +02:00
Beniamino Galvani
b1a81e5165 man: document 'rc-manager' option 2015-05-04 09:42:25 +02:00
Dan Winship
721e917cb6 wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.

So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.

For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.

nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-17 12:42:23 -04:00
Thomas Haller
10cde91f10 core: add "fatal-warnings" option to NM_DEBUG
NM already understands the command line argument --g-fatal-warnings
which causes setting of g_log_set_always_fatal().

Also interpret the "fatal-warnings" token in NM_DEBUG environment
variable and in main.debug configuration setting.

Usage hint: either set

  $ export NM_DEBUG=RLIMIT_CORE,fatal-warnings

or add the following section to NetworkManager.conf

    [main]
    debug=RLIMIT_CORE,fatal-warnings

https://mail.gnome.org/archives/networkmanager-list/2015-March/msg00093.html
2015-04-01 10:58:28 +02:00
Jiří Klimeš
9b464f8c65 man: add an example to nmcli manual page 2015-03-26 09:48:16 +01:00
Lubomir Rintel
85ee1f4a9c platform: give the platform an opportunity to override default-unmanaged
Some out of tree drivers add Ethernet devices that are supposed to be managed
by other their tooling, e.g. VirtualBox or VMWare.

Rather than hardcoding their drivers (at least VirtualBox doesn't even set a
"driver" property in sysfs) or hardcoding a logic that identifies such devices
let's just add a possibility to blacklist them in udev. This makes it possible
for whoever who ships such a driver to ship rules that prevent NetworkManager
from managing the device itself.

Furthermore it makes it possible for the user with special needs leverage the
flexibility of udev rules to override the defaults. In the end the user can
decide to let NetworkManager manage default-unmanaged interfaces such as VEth
or turn on default-unmanaged for devices on a particular bus.

An udev rule for VirtualBox would look like this:

  SUBSYSTEM=="net", ENV{INTERFACE}=="vboxnet[0-9]*", ENV{NM_UNMANAGED}="1"
2015-03-23 15:13:02 +01:00
Jiří Klimeš
b8a2f42a38 cli: allow multiple devices for 'nmcli device disconnect/delete' (bgo #746097)
Allow disconnecting and deleting multiple interfaces at a time. It is much
more user friendly. TAB and bash completions are supported as well.

https://bugzilla.gnome.org/show_bug.cgi?id=746097
2015-03-20 11:03:44 +01:00
Jiří Klimeš
f52e6bbdda cli: do not stall in 'nmcli connection delete/down' (rh #1168657)
NetworkManager only responds to the last D-Bus call when called delete/down
for the same connection in quick succession. (It should be fixed later).
So do not issue the call multiple times to prevent that. Otherwise nmcli would
stall waiting for the response.

https://bugzilla.redhat.com/show_bug.cgi?id=1168657
2015-03-16 16:58:05 +01:00
Dan Williams
cb17be1e12 man: note that dhcp=internal is required for configure-and-quit=true 2015-03-10 15:30:02 -05:00
Jiří Klimeš
591908c8bd nmcli: add support for bridge multicast-snooping property 2015-02-26 09:08:14 +01:00
Thomas Haller
b0f9e9bdfb man: explain the format for device specifier in manual page NetworkManager.conf 2015-02-24 10:38:37 +01:00
Bastien Nocera
06535fca29 man: fix small typo in nmcli man page
https://bugzilla.gnome.org/show_bug.cgi?id=745007
2015-02-23 14:21:26 +01:00
Jiří Klimeš
758e488f13 nmcli: add global '--colors' option for controlling color output
nmcli -c auto  ->  colors will only be used when stdout is a terminal
nmcli -c yes   ->  colors will be enabled unconditionally
nmcli -c no    ->  colors will be disabled unconditionally
2015-02-23 09:24:21 +01:00
Jiří Klimeš
40e98f5d68 nmcli: add --order option for 'nmcli connection show'
The option allows you to specify custom sorting order.
Default order (when no --order is provided) corresponds to -o "active:name:path"

Examples:
nmcli con show -o name
nmcli con show -o +name
  - sort connections by name alphabetically
nmcli con show -o -name
  - sort connections by name alphabetically in reverse order
mmcli con show -o active:name
  - sort connections first by active status, then by name
mmcli con show -o -path
  - sort connections by D-Bus path in reverse order
2015-02-23 09:24:21 +01:00
Lubomir Rintel
44e065359e dist: include manual page sources
Ommittes by mistake with an errorneous substitution.

https://mail.gnome.org/archives/networkmanager-list/2015-January/msg00066.html
2015-01-23 11:03:41 +01:00
Dan Winship
849ae9eed6 dispatcher: add an env var indicating a connection is "external"
Add CONNECTION_EXTERNAL=1 to the environment when dispatching actions
on a "generated-assumed" connection (ie, one that was created outside
of NM).
2015-01-19 11:19:33 -05:00
Dan Winship
995da9a5a6 dispatcher: expose connection D-Bus path
src/nm-dispatcher.c was passing the connection's D-Bus path to the
dispatcher, which was then ignoring it. Meanwhile,
test-dispatcher-envp was passing a fake D-Bus path with the wrong name
(which didn't actually matter since
nm_dispatcher_utils_construct_envp() ignored it anyway).

Fix it so that the path gets exposed as CONNECTION_DBUS_PATH, and
adjust the tests for that.
2015-01-19 11:17:37 -05:00
Jiří Klimeš
a3c52d7a33 man: add description of BOOTPROTO to nm-settings-ifcfg-rh manpage 2015-01-15 13:03:13 +01:00
Dan Winship
bd2deace70 dispatcher: pass CONNECTION_FILENAME to dispatcher scripts 2015-01-12 09:53:21 -05:00
Jiří Klimeš
da4a98bfbb man: allow installing pre-built manual pages if we can't build it
If we have ENABLE_GTK_DOCS, but not BUILD_SETTING_DOCS, nm-settings.5
nm-settings-keyfile.5 and nm-settings-ifcfg-rh.5 would not be installed.

(It happened on RHEL 7 build, due to missing BuildRequires: pygobject3-base)
2014-12-11 17:05:36 +01:00
Jiří Klimeš
4a7c88621d cli: fix deactivation for multiple connections (bgo #740775) (rh #1168383)
$ nmcli connection down aa bb cc

It has been broken by commit 20566c76de.

Fixups by dcbw.

https://bugzilla.gnome.org/show_bug.cgi?id=740775
https://bugzilla.redhat.com/show_bug.cgi?id=1168383
2014-12-03 10:54:49 +01:00
Dan Winship
93799e68ba man: document the "internal" DHCP client 2014-11-19 12:03:03 -05:00
Jiří Klimeš
9503d35d1e man: fix formatting leftover from man -> xml migration 2014-11-19 16:53:30 +01:00
Jiří Klimeš
3c8dfb91f6 man: update version reference to 1.0 in manual pages 2014-11-19 16:53:30 +01:00
Jiří Klimeš
9a13378753 dispatcher: introduce new env variables for gateway address (bgo #740363)
IP4_GATEWAY
VPN_IP4_GATEWAY
IP6_GATEWAY
VPN_IP6_GATEWAY

We still put gateway into IP[46]_ADDRESS_N for backward compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=740363
2014-11-19 16:52:25 +01:00
Jiří Klimeš
07bd9a1b76 man: ifcfg-rh manual page text update 2014-11-19 09:24:10 -05:00
Dan Winship
c7341c982d man, docs: add the secret flags notes non-hackishly
Since libnm-core secret-flags properties are now enum-typed rather
than just being uints, we can now actually recognize them when
generating docs, rather than just assuming that every property whose
name ends in '-flags', but isn't in NMSettingDcb, is a secret-flags
property.
2014-11-19 09:24:10 -05:00
Dan Winship
c14486984e libnm, libnm-util: move settings doc generation to libnm-core
Move the settings/plugins doc generation from libnm-util to
libnm-core, since libnm-util isn't being updated for all new
properties.

With this commit, the keyfile and ifcfg-rh documentation is basically
unchanged, except that deprecated properties are now gone, and new
properties have been added, and the sections are in a different order.
(generate-plugin-docs.pl just outputs the settings in Makefile order,
and they were unsorted in libnm-util, but are sorted in libnm-core).

The settings documentation used for nm-settings.5, the D-Bus API docs,
and the nmcli help is changed a bit more at this point, and mostly for
the worse, since the libnm-core setting properties don't match up with
the D-Bus API as well as the libnm-util ones do. To be fixed...

(I also removed the "plugins docs" line in each plugin docs comment
block while moving them, since those blocks will be used for more than
just plugins soon, and it's sort of obvious anyway.)
2014-11-19 09:24:09 -05:00
Jiří Klimeš
3889ff864c man: update nmcli-examples manual page 2014-11-19 15:21:34 +01:00
Jiří Klimeš
3595bef178 man: fix a typo in nmtui manual page 2014-11-19 13:22:28 +01:00
Dan Winship
16a9fc49dd docs: make the settings docs work from tarball builds
docs/api/settings-spec.xml was accidentally not getting disted,
because gtk-doc.make explicitly removes all DISTCLEANFILES from
distdir. However, it doesn't actually make sense for the settings docs
files to be in DISTCLEANFILES anyway; they were put there rather than
CLEANFILES (IIRC) so that "make clean" in a tarball build wouldn't
delete them and break things. But the right fix is to just make them
only be in CLEANFILES when BUILD_SETTING_DOCS is true, and not ever
get deleted otherwise.

Also adjust the build rules to ensure that the generated docs don't
get rebuilt in tarball builds, since that can cause problems when
building from a read-only source tree, etc.

Meanwhile, in an unrelated but also fatal bug, configure.ac's check
for if the generated docs were already present never got updated for
the cli/src -> clients/cli move, and so even if we had been disting
settings-spec.xml, configure would still think that the tarball didn't
have all of the generated docs in it, so SETTING_DOCS_AVAILABLE would
be set false and none of the generated docs would get used.

https://bugzilla.gnome.org/show_bug.cgi?id=740035
2014-11-14 17:14:18 -05:00
Thomas Haller
dd9bb5f376 man: fix make uninstall to remove the nmtui manual pages
Fixes: 1e8b681d4f
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-11-12 17:40:05 +01:00
Thomas Haller
1e8b681d4f man: add manual page for nmtui(1)
https://bugzilla.gnome.org/show_bug.cgi?id=739710

Branch: th/bgo739710_man_nmtui
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-11-11 16:01:38 +01:00