Skip to content

A sysadmin’s guide to network interface configuration |Opensource

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 variableDescription
TYPEType of network such as Ethernet or token ring.
PROXY_METHODProxy configuration method. “none” means no proxy is in use.
BROWSER_ONLYWhether a proxy configuration is for browsers only.
BOOTPROTOOptions are dhcp, bootp, none, and static. The “none” option implies DHCP.
DEFROUTEThis interface is the default route for this host to the outside world.
IPv4_FAILURE_FATALIf this is set to “no” failure to obtain an IPv4 connection will not affect any attempt to make an IPv6 connection.
NAMEThe interface name, such as enp0s3. This should match the interface name in the interface configuration file name.
UUIDA 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.
DEVICEThe name of the interface to which this configuration file is bound.
ONBOOTIf 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.
HWADDRThe 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, DNS2Up to two name servers may be specified.
USERCTLSpecifies whether non-privileged users may start and stop this interface. Options are yes/no.
IPADDRThe IP Address assigned to this NIC.
BROADCASTThe broadcast address for this network such as 10.0.2.255.
NETMASKThe netmask for this subnet such as 255.255.255.0. Use either NETMASK or PREFIX but not both.
PREFIXThe CIDR prefix for the network such as 24. Use either NETMASK or PREFIX but not both.
NETWORKThe network ID for this subnet such as 10.0.2.0.
SEARCHThe DNS domain name to search when doing lookups on unqualified hostnames such as using studentvm1 instead of studentvm1.example.com.
GATEWAYThe network router or default gateway for this subnet, such as 10.0.2.1.
PEERDNSThe 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.
IPv6INITWhether to initialize IPv6 or not. The default is yes.
IPv6_AUTOCONFYes means use DHCP for configuration of IPv6 on this interface.
IPv6_DEFROUTEThis interface is the IPv6 default route for this host to the outside world.
IPv6_FAILURE_FATALIf this is set to “no” failure to obtain an IPv6 connection will not affect any attempt to make an IPv4 connection.
IPv6_ADDR_GEN_MODEConfigure 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

Leave a Reply

Your email address will not be published. Required fields are marked *

Exit mobile version