/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 ifcfg
files in the /etc/sysconfig/network-scripts/
directory.
/etc/sysconfig/network
is for global settings. Information for VPNs, mobile broadband and PPPoE connections is stored in /etc/NetworkManager/system-connections/
.
ifcfg
file, 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 root
:
~]# nmcli connection reload
The above command reads all connection profiles. Alternatively, to reload only one changed file, ifcfg-ifname
, issue a command as follows:
~]# nmcli con load /etc/sysconfig/network-scripts/ifcfg-ifname
The command accepts multiple file names. These commands require root
privileges. For more information on user privileges and gaining privileges, see the Fedora 20 System Administrator's Guide and the su(1)
and sudo(8)
man pages.
nmcli dev disconnect interface-nameFollowed by:
nmcli con up interface-name
ifup
commands are used. See Section 1.6, “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-ethX
, ifup-wireless
, ifup-ppp
, and so on. When a user runs ifup eth0
manually, the following occurs:
ifup
looks for a file called /etc/sysconfig/network-scripts/ifcfg-eth0
;
ifcfg
file exists, ifup
looks for the TYPE
key in that file to determine which type-specific script to call;
ifup
calls ifup-wireless
or ifup-eth
or ifup-XXX
based on TYPE
;
IP
-related tasks like DHCP
or static setup.
/etc/init.d/network
reads through all the ifcfg
files and for each one that has ONBOOT=yes
, it checks whether NetworkManager is already starting the DEVICE from that ifcfg
file. If NetworkManager is starting that device or has already started it, nothing more is done for that file, and the next ONBOOT=yes
file is checked. If NetworkManager is not yet starting that device, the initscripts will continue with their traditional behavior and call ifup
for that ifcfg
file.
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 dialup 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.
Note
ifcfg
files in the same location as the live ones. The script literally does ifcfg-*
with an exclude only for these extensions: .old
, .orig
, .rpmnew
, .rpmorig
, and .rpmsave
. The best way is not to store backup files anywhere within the /etc/
directory.