banner
News center
First-rate components, precise quality management.

How to List All Physical Ethernet Ports on a Linux Server

Sep 27, 2023

Want to know the number of Ethernet ports your Linux server has, without physically going to the server room? The lspci command is there to help you.

Rack servers are designed to support enterprise-grade systems and operations. Unlike regular servers, rack servers must be resilient and usually contain several physical Ethernet ports or Network Interface Cards (NICs) to be able to connect to several networks at once.

Apart from rack servers, some industrial or specialized PCs also come with multiple Ethernet ports or NICs.

Whatever the case, here's how you can find out the number of Ethernet ports on a Linux server without physically going to the server room to inspect.

Most rack servers or industrial PCs have multiple Network Interface Cards (NICs) for the following reasons:

Overall, multiple network interfaces in your server network provide better performance and robustness.

The lspci command lists all Peripheral Component Interconnect (PCI) devices on your machine. PCI is a standard protocol that allows computers to connect and communicate via physical interfaces such as NICs, video cards, etc.

Since we are only interested in Ethernet ports, filter the listing accordingly using the grep command as follows:

The output list all the NICs on this server; as you can see, there are eight in total. In addition to listing the NICs, you'll also get the manufacturer of the NIC and its type: Ethernet, in this case.

To only show the total number of ports without a detailed listing, use the following command:

Servers that come with multiple physical Ethernet ports offer better performance and are more robust and resilient in comparison to PCs that only come with a single NIC.

Linux comes with many built-in tools, such as the ip command, for configuring and managing your network.

Mwiza develops software by profession and has been writing extensively on Linux and front-end programming since 2019. He has a master's in Information Systems and is a certified C# developer.Some of his interests include history, economics, politics & enterprise architecture.

MAKEUSEOF VIDEO OF THE DAY SCROLL TO CONTINUE WITH CONTENT Network segmentation: Virtualization: Redundancy: lspci ip