1.8. NetworkManager and the Network Scripts
/etc/init.d/network/and any other installed scripts it calls. The user supplied files are typically viewed as configuration, but can also be interpreted as an amendment to the scripts.
Running Network Script
/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/networkscript 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 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-localscript 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 the section called “Running Dispatcher scripts” for an explanation of the dispatcher scripts.
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.
Running Dispatcher scripts
/etc/NetworkManager/dispatcher.d/directory 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.