The linux command-line utility for network interface configuration is called:

Skip to navigation Skip to main content

Utilities

  • Subscriptions
  • Downloads
  • Containers
  • Support Cases

The linux command-line utility for network interface configuration is called:

Infrastructure and Management

  • Red Hat Enterprise Linux
  • Red Hat Virtualization
  • Red Hat Identity Management
  • Red Hat Directory Server
  • Red Hat Certificate System
  • Red Hat Satellite
  • Red Hat Subscription Management
  • Red Hat Update Infrastructure
  • Red Hat Insights
  • Red Hat Ansible Automation Platform

Cloud Computing

  • Red Hat OpenShift
  • Red Hat CloudForms
  • Red Hat OpenStack Platform
  • Red Hat OpenShift Container Platform
  • Red Hat OpenShift Data Science
  • Red Hat OpenShift Online
  • Red Hat OpenShift Dedicated
  • Red Hat Advanced Cluster Security for Kubernetes
  • Red Hat Advanced Cluster Management for Kubernetes
  • Red Hat Quay
  • OpenShift Dev Spaces
  • Red Hat OpenShift Service on AWS

Storage

  • Red Hat Gluster Storage
  • Red Hat Hyperconverged Infrastructure
  • Red Hat Ceph Storage
  • Red Hat OpenShift Data Foundation

Runtimes

  • Red Hat Runtimes
  • Red Hat JBoss Enterprise Application Platform
  • Red Hat Data Grid
  • Red Hat JBoss Web Server
  • Red Hat Single Sign On
  • Red Hat support for Spring Boot
  • Red Hat build of Node.js
  • Red Hat build of Thorntail
  • Red Hat build of Eclipse Vert.x
  • Red Hat build of OpenJDK
  • Red Hat build of Quarkus

Integration and Automation

  • Red Hat Process Automation
  • Red Hat Process Automation Manager
  • Red Hat Decision Manager

All Products

9.3.1. Check if Bridging Kernel Module is Installed

In Red Hat Enterprise Linux 7, the bridging module is loaded by default. If necessary, you can make sure that the module is loaded by issuing the following command as root:

~]# modprobe --first-time bridge
modprobe: ERROR: could not insert 'bridge': Module already in kernel

To display information about the module, issue the following command:

~]$ modinfo bridge

See the modprobe(8) man page for more command options.

9.3.2. Create a Network Bridge

To create a network bridge, create a file in the /etc/sysconfig/network-scripts/ directory called ifcfg-brN, replacing N with the number for the interface, such as 0.

The contents of the file is similar to whatever type of interface is getting bridged to, such as an Ethernet interface. The differences in this example are as follows:

  • The DEVICE directive is given an interface name as its argument in the format brN, where N is replaced with the number of the interface.

  • The TYPE directive is given an argument Bridge. This directive determines the device type and the argument is case sensitive.

  • The bridge interface configuration file is given an IP address whereas the physical interface configuration file must only have a MAC address (see below).

  • An extra directive, DELAY=0, is added to prevent the bridge from waiting while it monitors traffic, learns where hosts are located, and builds a table of MAC addresses on which to base its filtering decisions. The default delay of 15 seconds is not needed if no routing loops are possible.

Example 9.1. Example ifcfg-br0 Interface Configuration File

The following is an example of a bridge interface configuration file using a static IP address:

DEVICE=br0
TYPE=Bridge
IPADDR=192.168.1.1
PREFIX=24
BOOTPROTO=none
ONBOOT=yes
DELAY=0

To complete the bridge another interface is created, or an existing interface is modified, and pointed to the bridge interface.

Example 9.2. Example ifcfg-enp1s0 Interface Configuration File

The following is an example of an Ethernet interface configuration file pointing to a bridge interface. Configure your physical interface in /etc/sysconfig/network-scripts/ifcfg-device_name, where device_name is the name of the interface

DEVICE=device_name
TYPE=Ethernet
HWADDR=AA:BB:CC:DD:EE:FF
BOOTPROTO=none
ONBOOT=yes
BRIDGE=br0

Optionally specify a name using the NAME directive. If no name is specified, the NetworkManager plug-in, ifcfg-rh, will create a name for the connection profile in the form Type Interface. In this example, this means the bridge will be named Bridge br0. Alternately, if NAME=bridge-br0 is added to the ifcfg-br0 file the connection profile will be named bridge-br0.

For the DEVICE directive, almost any interface name could be used as it does not determine the device type. TYPE=Ethernet is not strictly required. If the TYPE directive is not set, the device is treated as an Ethernet device (unless its name explicitly matches a different interface configuration file).

The directives are case sensitive.

If you are configuring bridging on a remote host, and you are connected to that host over the physical NIC you are configuring, consider the implications of losing connectivity before proceeding. You will lose connectivity when restarting the service and may not be able to regain connectivity if any errors have been made. Console, or out-of-band access is advised.

To open the new or recently configured interfaces, issue a command as root in the following format:

ifup device

This command will detect if NetworkManager is running and call nmcli con load UUID and then call nmcli con up UUID.

Alternatively, to reload all interfaces, issue the following command as root:

~]# systemctl restart network

This command will stop the network service, start the network service, and then call ifup for all ifcfg files with ONBOOT=yes.

The default behavior is for NetworkManager not to be aware of changes to ifcfg files and to continue using the old configuration data until the interface is next brought up. This is set by the monitor-connection-files option in the NetworkManager.conf file. See the NetworkManager.conf(5) manual page for more information.

9.3.3. Network Bridge with Bond

An example of a network bridge formed from two or more bonded Ethernet interfaces will now be given as this is another common application in a virtualization environment. If you are not very familiar with the configuration files for bonded interfaces, see Section 7.4.2, “Create a Channel Bonding Interface”

Create or edit two or more Ethernet interface configuration files, which are to be bonded, as follows:

DEVICE=interface_name
TYPE=Ethernet
SLAVE=yes
MASTER=bond0
BOOTPROTO=none
HWADDR=AA:BB:CC:DD:EE:FF

Using interface_name as the interface name is common practice but almost any name could be used.

Create or edit one interface configuration file, /etc/sysconfig/network-scripts/ifcfg-bond0, as follows:

DEVICE=bond0
ONBOOT=yes
BONDING_OPTS='mode=1 miimon=100'
BRIDGE=brbond0

For further instructions and advice on configuring the bonding module and to view the list of bonding parameters, see Section 7.7, “Using Channel Bonding”.

Create or edit one interface configuration file, /etc/sysconfig/network-scripts/ifcfg-brbond0, as follows:

DEVICE=brbond0
ONBOOT=yes
TYPE=Bridge
IPADDR=192.168.1.1
PREFIX=24

We now have two or more interface configuration files with the MASTER=bond0 directive. These point to the configuration file named /etc/sysconfig/network-scripts/ifcfg-bond0, which contains the DEVICE=bond0 directive. This ifcfg-bond0 in turn points to the /etc/sysconfig/network-scripts/ifcfg-brbond0 configuration file, which contains the IP address, and acts as an interface to the virtual networks inside the host.

To open the new or recently configured interfaces, issue a command as root in the following format:

ifup device

This command will detect if NetworkManager is running and call nmcli con load UUID and then call nmcli con up UUID.

Alternatively, to reload all interfaces, issue the following command as root:

~]# systemctl restart network

This command will stop the network service, start the network service, and then call ifup for all ifcfg files with ONBOOT=yes.

The default behavior is for NetworkManager not to be aware of changes to ifcfg files and to continue using the old configuration data until the interface is next brought up. This is set by the monitor-connection-files option in the NetworkManager.conf file. See the NetworkManager.conf(5) manual page for more information.

  1. Previous
  2. Next

Which Linux command shows network interface configurations?

The “ifconfig” command is used for displaying current network configuration information, setting up an ip address, netmask, or broadcast address to a network interface, creating an alias for the network interface, setting up hardware address, and enable or disable network interfaces.

What is network interface command in Linux?

Linux ifconfig stands for interface configurator. It is one of the most basic commands used in network inspection. ifconfig is used to initialize an interface, configure it with an IP address, and enable or disable it. It is also used to display the route and the network interface.

What is command line utilities in Linux?

The Linux command is a utility of the Linux operating system. All basic and advanced tasks can be done by executing commands. The commands are executed on the Linux terminal. The terminal is a command-line interface to interact with the system, which is similar to the command prompt in the Windows OS.

What is the name of the network interface Linux?

Linux systems use two different styles of naming the network interfaces. The first style is the old-style name, such as eth0, eth1, and wlan0. The new ones are based on hardware locations like enp3s0 and wlp2s0. Here, we can see three network interfaces, their type, and their state.