The network interface must be enabled and functioning properly to either connect with the internet or locally. To have a functional network interface, one must keep an eye on the status of the network interface. This article provides the possible ways to get the status of the network interface on CentOS 8.
How to check the status of the network interface on CentOS 8
Like various other Linux distros, CentOS 8 comes up with a list of networking-related commands to configure the network. Here, we have provided a detailed list of those commands and will demonstrate how these commands can provide us with the status of the network interface.
Using ifconfig command
The ifconfig is the powerful networking command used to get the information of network interfaces on Linux. It shows the status of the network interfaces on CentOS as we did here.
The output shows the network interface status and currently, all the network interfaces are UP.
Note: The loopback(lo) interface represents the host itself (localhost) and is known as a virtual network interface. Where the physical network interface is usually known as ethernet (ens33 in our case) which is responsible for communicating with various computers over the network or on the internet. Lastly, the virbr0 interface is responsible for establishing the connection between the guest and the virtualization host.
Using the ip command
The ip command is another useful networking tool for system/network administrators of CentOS. The following ip command on CentOS 9 would present the status of the network interface.
All the available network interfaces are listed down, and all the network interfaces are up (enabled).
Using nmcli command
It is another favorite command-line utility of network admins to manage the network. Basically, it represents the command line interface of the network manager. It prints various settings related to the network manager of Linux. For instance, we made use of the nmcli command to check the status of network interfaces via the following command.
$ sudo nmcli device status
The output shows that the loopback interface is unmanaged by the network manager whereas the ens33 and virbr0 are connected.
The network interface status can be obtained using the ifconfig, ip, or nmcli command. A network interface is referred to as the non-physical network interface card. Generally, a network interface is the interconnection of the computer and public/private networks. There, it has a key role in establishing a network connection that makes it a favorite tool of system/network administrators.