The NetworkManager DaemonThe NetworkManager daemon runs with root privileges and is, by default, configured to start up at boot time. You can determine whether the NetworkManager daemon is running by entering this command:
systemctl status NetworkManagerNetworkManager.service - Network Manager Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled) Active: active (running) since Fri, 08 Mar 2013 12:50:04 +0100; 3 days ago
systemctl statuscommand will report NetworkManager as
Active: inactive (dead)if the NetworkManager service is not running. To start it for the current session enter the following command as the root user:
systemctl start NetworkManager
systemctl enablecommand to ensure that NetworkManager starts up every time the system boots:
~]#For more information on starting, stopping and managing services, see the Red Hat Enterprise Linux 7 System Administrator's Guide.
systemctl enable NetworkManager
1.4.2. Interacting with NetworkManagerUsers do not interact with the NetworkManager system service directly. Instead, users perform network configuration tasks using graphical and command-line user interface tools. The following tools are available in Red Hat Enterprise Linux 7:
- A simple curses-based text user interface (TUI) for NetworkManager, nmtui, is available.
- A command-line tool, nmcli, is provided to allow users and scripts to interact with NetworkManager. Note that nmcli can be used on systems without a GUI such as servers to control all aspects of NetworkManager. It is on an equal footing with the GUI tools.
- The GNOME Shell also provides a network icon in its Notification Area representing network connection states as reported by NetworkManager. The icon has multiple states that serve as visual indicators for the type of connection you are currently using.
- A graphical user interface tool called control-center, provided
by the GNOME Shell, is available for desktop users. It incorporates a Network settings
tool. To start it, press the Super key to enter the Activities Overview, type
control networkand then press Enter. The Super key appears in a variety of guises, depending on the keyboard and other hardware, but often as either the Windows or Command key, and typically to the left of the Space key.
- A graphical user interface tool, nm-connection-editor, is available
for certain tasks not yet handled by control-center. To start it, press the
Super key to enter the Activities Overview, type
nm-connection-editorand then press Enter.
1.7. Network Configuration Using the Command-Line Interface (CLI)
The commands for the ip utility, sometimes referred to as iproute2 after the
upstream package name, are documented in the
man ip(8) page. The package
name in Red Hat Enterprise Linux 7 is iproute. If necessary, you can check that the ip
utility is installed by checking its version number as follows:
~]$The ip commands can be used to add and remove addresses and routes to interfaces in parallel with NetworkManager, which will preserve them and recognize them in nmcli, nmtui, control-center, and the D-Bus API.
ip -Vip utility, iproute2-ss130716
Note that the ip utility replaces the
because the net-tools package (which provides
ifconfig) does not support
InfiniBand addresses. The command
ip help prints a usage message. Specific
help is available for OBJECTS, for example:
ip link help and
ip addr help.
ip commands given on the command line will not persist after
a system restart. Where persistence is required, make use of configuration files (
files) or add the commands to a script.
Running Network ScriptRun the script only with the systemctl utility which will clear any existing environment variables and ensure clean execution. The command takes the following form:
Note that in Red Hat Enterprise Linux 7, NetworkManager is started first, and
systemctl start|stop|restart|status network
/etc/init.d/networkchecks with NetworkManager to avoid tampering with NetworkManager's connections. NetworkManager is intended to be the primary application using sysconfig configuration files and
/etc/init.d/networkis intended to be secondary, playing a fallback role.
/etc/init.d/network script is not event-driven, it runs either:
- manually (by one of the
- on boot and shutdown if the network service is enabled (as a result of the command
systemctl enable network).
Custom Commands and the Network ScriptsCustom commands in the scripts
ifdown-localare only executed when those devices are controlled by the
ifup-localfile does not exist by default. If required, create it under the
ifup-local script is readable only by the initscripts and not by
NetworkManager. To run a custom script using NetworkManager, create
it under the
dispatcher.d directory. See
Section 1.8, "Running Dispatcher scripts" for an explanation of the dispatcher scripts.
Red Hat does not provide support if a user modifies any files included with the initscripts package or related rpms.There are ways to perform custom tasks when network connections go up and down, both with the old network scripts and with NetworkManager. When NetworkManager is enabled, the
ifdownscript will ask NetworkManager whether NetworkManager manages the interface in question, which is found from the "DEVICE=" line in the
ifcfgfile. If NetworkManager does manage that device, and the device is not already connected, then
ifupwill ask NetworkManager to start the connection.
- If the device is managed by NetworkManager and it is already connected, nothing is done.
- If the device is not managed by NetworkManager, then the scripts will start the connection using the older, non-NetworkManager mechanisms that they have used since the time before NetworkManager existed.
ifdownand the device is managed by NetworkManager, then
ifdownwill ask NetworkManager to terminate the connection.
The scripts dynamically check NetworkManager, so if NetworkManager is not running, the scripts will fall back to the old, pre-NetworkManager script-based mechanisms.
Running Dispatcher scriptsNetworkManager provides a way to run additional custom scripts to start or stop services based on the connection status. By default, the
/etc/NetworkManager/dispatcher.ddirectory exists and NetworkManager runs scripts there, in alphabetical order. Each script must be an executable file owned by
rootand must have
write permissiononly for the file owner. For more information about running NetworkManager dispatcher scripts, see the Red Hat Knowledgebase solution How to write a NetworkManager dispatcher script to apply ethtool commands.
- 190317 : 1.9. Network Configuration Using sysconfig Files ( softpanorama.org, )
Old News ;-)
1.9. Network Configuration Using sysconfig Files
/etc/sysconfig/directory is a location for configuration files and scripts. Most network configuration information is stored there, with the exception of VPN, mobile broadband and PPPoE configuration, which are stored in
/etc/NetworkManager/subdirectories. Interface specific information for example, is stored in
ifcfgfiles in the
/etc/sysconfig/networkis for global settings. Information for VPNs, mobile broadband and PPPoE connections is stored in
In Red Hat Enterprise Linux 7 when you edit an
NetworkManager is not automatically aware of the change and has to be prompted to notice the
change. If you use one of the tools to update NetworkManager profile settings, then
NetworkManager does not implement those changes until you reconnect using that profile.
For example, if configuration files have been changed using an editor, NetworkManager
must be told to read the configuration files again. To do that, issue the following command as
~]#The above command reads all connection profiles. Alternatively, to reload only one changed file,
nmcli connection reload
ifcfg-ifname, issue a command as follows:
~]#The command accepts multiple file names. These commands require
nmcli con load /etc/sysconfig/network-scripts/ifcfg-ifname
rootprivileges. For more information on user privileges and gaining privileges, see the Red Hat Enterprise Linux 7 System Administrator's Guide and the
Changes made using tools such as nmcli do not require a reload but do require the associated interface to be put down and then up again. That can be done by using commands in the following format:
nmcli dev disconnect interface-nameFollowed by:
nmcli con up interface-nameNetworkManager does not trigger any of the network scripts, though the network scripts will try to trigger NetworkManager if it is running when
ifupcommands are used. See Section 1.8, "NetworkManager and the Network Scripts" for an explanation of the network scripts.
ifup script is a generic script which does a few things and then
calls interface-specific scripts like
ifup-ppp, and so on. When
a user runs
ifup eth0 manually, the following occurs:
ifuplooks for a file called
- if the
ifuplooks for the
TYPEkey in that file to determine which type-specific script to call;
- the type-specific scripts do type-specific setup;
- and then the type-specific scripts let common functions perform
IP-related tasks like
DHCPor static setup.
/etc/init.d/networkreads through all the
ifcfgfiles and for each one that has
ONBOOT=yes, it checks whether NetworkManager is already starting the DEVICE from that
ifcfgfile. If NetworkManager is starting that device or has already started it, nothing more is done for that file, and the next
ONBOOT=yesfile is checked. If NetworkManager is not yet starting that device, the initscripts will continue with their traditional behavior and call
The end result is that any
ifcfg file that has
ONBOOT=yes is expected to be started on system bootup, either by
NetworkManager or by the initscripts. This ensures that some legacy network types which
NetworkManager does not handle (such as ISDN or analog dial-up modems) as well as any
new application not yet supported by NetworkManager are still correctly started by
the initscripts even though NetworkManager is unable to handle them.
It is recommended not to store backup
in the same location as the live ones. The script literally does
with an exclude only for these extensions:
.rpmsave. The best way is not to store backup files anywhere within
Google matched content
man(1)man page - Describes man pages and how to find them.
NetworkManager(8)man page - Describes the network management daemon.
NetworkManager.conf(5)man page - Describes the
ifcfgconfiguration files and their directives as understood by the legacy network service.
/usr/share/doc/initscripts-version/examples/networking/- A directory containing example configuration files.
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2018 by Dr. Nikolai Bezroukov. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info|
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.
Last modified: March 12, 2019