NetworkManager Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=External=
* https://people.freedesktop.org/~lkundrak/nm-docs/NetworkManager.html
=Internal=
=Internal=



Revision as of 13:46, 25 May 2017

External

Internal

Overview

NetworkManager is the default networking service in RHEL 7. It represents a dynamic network control and configuration daemon that attempts to keep network devices and connections up and active when they are available. NetworkManager can configure network aliases, IP addresses, static routes, DNS information and VPN connections. NetworkManager also provides an API via D-Bus which allows applications to query and control network configuration and state.

Theoretically, NetworkManager should coexist with ifcfg scripts.

NetworkManager may overwrite the content of the following:

but it can be configured to not do so. See Configuration for more details.

In a systemd driven system, NetworkManager pulls the network.target.

Dispatcher Scripts

NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher.d directory or subdirectories in alphabetical order in response to network events. Each script should be a regular executable file owned by root, must not be writable by group or other, and not setuid. Each script receives two arguments, the first being the interface name of the device an operation just happened on, and second the action:

  • pre-up - the interface is connected to the network but is not yet fully activated. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-up.d directory, and NetworkManager will wait for script execution to complete before indicating to applications that the interface is fully activated.
  • up - the interface has been activated.
  • pre-down - the interface will be deactivated but has not yet been disconnected from the network. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-down.d directory, and NetworkManager will wait for script execution to complete before disconnecting the interface from its network. Note that this event is not emitted for forced disconnections, like when carrier is lost or a wireless signal fades. It is only emitted when there is an opportunity to cleanly handle a network disconnection event.
  • down - the interface has been deactivated.
  • vpn-pre-up - the VPN is connected to the network but is not yet fully activated. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-up.d directory, and NetworkManager will wait for script execution to complete before indicating to applications that the VPN is fully activated.
  • vpn-up - a VPN connection has been activated.
  • vpn-pre-down - the VPN will be deactivated but has not yet been disconnected from the network. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-down.d directory, and NetworkManager will wait for script execution to complete before disconnecting the VPN from its network. Note that this event is not emitted for forced disconnections, like when the VPN terminates unexpectedly or general connectivity is lost. It is only emitted when there is an opportunity to cleanly handle a VPN disconnection event.
  • vpn-down - a VPN connection has been deactivated.
  • hostname - the system hostname has been updated. The interface name (first argument) is empty and no environment variable is set for this action.
  • dhcp4-change - the DHCPv4 lease has changed (renewed, rebound, etc).
  • dhcp6-change - the DHCPv6 lease has changed (renewed, rebound, etc).

Connection

Device