In the first article of this series, Get started with NetworkManager on Linux, I looked at what NetworkManager does and some of the tools it provides for viewing network connections and devices. I discussed using the nmcli command to view the status of network devices and connections on a host. I also mentioned that NetworkManager does not need interface configuration files for most hosts. However, it can create its own INI-style connection configuration files, and it recognizes the older and now deprecated network interface configuration files.
This article explores three questions:
- Why do I not use interface configuration files?
- Why do I use interface configuration files?
- Why do I use the old network interface configuration files?
Network configuration variables
The table below lists the most common network configuration variables, along with some brief explanations for each. Many IPv6 options are functionally equivalent to the similarly named IPv4 ones. Local configuration variable settings override those provided by a DHCP server. You can use DHCP for configuring a host but use an interface configuration file to override one or more of the DHCP configuration variables.
| Configuration variable | Description |
|---|---|
| TYPE | Type of network such as Ethernet or token ring. |
| PROXY_METHOD | Proxy configuration method. “none” means no proxy is in use. |
| BROWSER_ONLY | Whether a proxy configuration is for browsers only. |
| BOOTPROTO | Options are dhcp, bootp, none, and static. The “none” option implies DHCP. |
| DEFROUTE | This interface is the default route for this host to the outside world. |
| IPv4_FAILURE_FATAL | If this is set to “no” failure to obtain an IPv4 connection will not affect any attempt to make an IPv6 connection. |
| NAME | The interface name, such as enp0s3. This should match the interface name in the interface configuration file name. |
| UUID | A Universally Unique Identifier for the interface. It is created with a hash of the interface name. The HWADDR is an older means of bonding the file to the hardware interface, and I have found that the UUID can be commented out or deleted without issues. |
| DEVICE | The name of the interface to which this configuration file is bound. |
| ONBOOT | If yes, this starts the interface at boot (really startup time). If set to no, the interface is not started until a user logs in at the GUI or manually starts the interface. |
| HWADDR | The MAC address of the interface. This is one of the more important fields in the file as it is used to bond the file to the correct hardware interface. The UUID is a more recent addition and can also be used, but the HWADDR was first and is more widely used. |
| DNS1, DNS2 | Up to two name servers may be specified. |
| USERCTL | Specifies whether non-privileged users may start and stop this interface. Options are yes/no. |
| IPADDR | The IP Address assigned to this NIC. |
| BROADCAST | The broadcast address for this network such as 10.0.2.255. |
| NETMASK | The netmask for this subnet such as 255.255.255.0. Use either NETMASK or PREFIX but not both. |
| PREFIX | The CIDR prefix for the network such as 24. Use either NETMASK or PREFIX but not both. |
| NETWORK | The network ID for this subnet such as 10.0.2.0. |
| SEARCH | The DNS domain name to search when doing lookups on unqualified hostnames such as using studentvm1 instead of studentvm1.example.com. |
| GATEWAY | The network router or default gateway for this subnet, such as 10.0.2.1. |
| PEERDNS | The yes value indicates that /etc/resolv.conf is to be modified by inserting the DNS server entries specified by DNS1 and DNS2 options in this file. No means do not alter the resolv.conf file. Yes is the default when DHCP is specified in the BOOTPROTO line. |
| IPv6INIT | Whether to initialize IPv6 or not. The default is yes. |
| IPv6_AUTOCONF | Yes means use DHCP for configuration of IPv6 on this interface. |
| IPv6_DEFROUTE | This interface is the IPv6 default route for this host to the outside world. |
| IPv6_FAILURE_FATAL | If this is set to “no” failure to obtain an IPv6 connection will not affect any attempt to make an IPv4 connection. |
| IPv6_ADDR_GEN_MODE | Configure IPv6 Stable Privacy addressing. |
There are many more configuration variables than are listed here, but these are the ones that are most frequently used.
More & posted from