RHCSA Rapid Track
Modify network configuration files.
Objectives
After completing this section, students should be able to modify network settings by editing the configuration files.
Modifying network configuration
It is also possible to configure the network by editing interface
configuration files. Interface configuration files control the software
interfaces for individual network devices. These files are usually named
/etc/sysconfig/network-scripts/ifcfg-<name>,
where <name> refers to the name of the device or connection that the
configuration file controls. The following are standard variables found
in the file used for static or dynamic configuration.
Table 10.3. Configuration Options for ifcfg File
| Static | Dynamic | Either |
|---|---|---|
|
|
|
|
In the static settings, variables for IP address, prefix, and gateway have a number at the end. This allows multiple sets of values to be assigned to the interface. The DNS variable also has a number which is used to specify the order of lookup when multiple servers are specified.
After modifying the configuration files, run nmcli con reload to make NetworkManager read the configuration changes. The interface still needs to be restarted for changes to take effect.
[root@serverX ~]#nmcli con reload[root@serverX ~]#nmcli con down "System eth0"[root@serverX ~]#nmcli con up "System eth0"
References
nmcli(1) man page
Additional information may be available in the chapter on configuring networking in the Red Hat Enterprise Linux Networking Guide for Red Hat Enterprise Linux 7, which can be found at https://access.redhat.com/documentation/