- HowTo: Linux Show List Of Network Cards
- Use lspci command Linux command to show list of network cards
- How to use lshw command for displaying network cards (NIC) on Linux
- Linux ethtool command for Ethernet hardware devices
- ifconfig and ip commands
- Listing network cards on Linux using hwinfo command
- The /proc/net/dev file
- Conclusion
- Linux hardware nic netxtreme
- Introduction
- Limitations
- bnx2 Driver
- bnx2x Driver
- bnx2i Driver
- Packaging
- Installing Linux Driver Software
- Installing the Source RPM Package
- Installing the KMP Package
- Building the Driver from the Source TAR File
- ifconfig eth0 up Load and Run Necessary iSCSI Software Components
HowTo: Linux Show List Of Network Cards
H ow do I display a list of all network cards under Linux operating systems?
You can use any one of the following command to list network cards installed under Linux operating systems. Please note that the ifconfig and ip commands will also display interfaces information about vpn, loopback, and other configured interfaces.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | Yes |
Requirements | Linux |
Est. reading time | 2m |
- lspci command : List all PCI devices.
- lshw command : List all hardware.
- dmidecode command : List all hardware data from BIOS.
- ifconfig command : Outdated network config utility.
- ip command : Recommended new network config utility.
- hwinfo command : Probe Linux for network cards.
- ethtool command : See NIC/card driver and settings on Linux.
We use standard terms, such as the network interface controller (NIC). Also known as a network interface card, network adapter, LAN adapter or physical network interface, and so on. Let us see some useful examples for displing out NIC info on Linux.
Use lspci command Linux command to show list of network cards
Type the following lspci command along with egrep command to filter out devices:
# lspci | egrep -i —color ‘network|ethernet’
# lspci | egrep -i —color ‘network|ethernet|wireless|wi-fi’
Sample outputs from my Linux server:
How to use lshw command for displaying network cards (NIC) on Linux
The lshw command can extract detailed information on the hardware configuration of the machine including network cards. Type the following command:
# lshw -class network
Detailed hardware information about network cards on Linux:
Here is another outputs:
- -class network : View all network cards on your Linux system
- -short : Display device tree showing hardware paths, very much like the output of HP-UX’s ioscan
Let us see mask, IP and other information set up for wlp82s0:
$ ip a show wlp82s0
Linux ethtool command for Ethernet hardware devices
Want to see/query or control network driver and hardware settings on Linux? Try the the ethtool command:
$ sudo ethtool enp0s31f6
And it spitted out tons of useful information for my Ethernet network card on Linux:
We can display driver information for network card too:
$ sudo ethtool -i eth0
$ sudo ethtool -i enp0s31f6
ifconfig and ip commands
To see all configured network devices, enter:
# ifconfig -a
OR
# ip link show
OR
# ip a
Sample outputs:
Want to list all IP addresses and interfaces on Linux in a tabular format for better readability? Try:
$ ip -br -c link show
$ ip -br -c addr show
Listing network cards on Linux using hwinfo command
Open the terminal and then type:
$ sudo hwinfo —network —short
We can now obtain more info for eth0 using the ip command:
$ ip a s eth0
My IP address assigned to eth0:
The /proc/net/dev file
The dev pseudo-file contains network device status information. This gives the number of received and sent packets, the number of errors and collisions and other basic statistics. Open the terminal and then type the following cat command:
$ cat /proc/net/dev
Stats:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
Conclusion
We learned about various Linux commands to display information about installed and running network cards.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Category | List of Unix and Linux commands |
---|---|
Documentation | help • mandb • man • pinfo |
Disk space analyzers | df • duf • ncdu • pydf |
File Management | cat • cp • less • mkdir • more • tree |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Linux Desktop Apps | Skype • Spotify • VLC 3 |
Modern utilities | bat • exa |
Network Utilities | NetHogs • dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop |
Searching | ag • grep • whereis • which |
Shell builtins | compgen • echo • printf |
Text processing | cut • rev |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Comments on this entry are closed.
In which distro are you using the ip command? I’m trying it in Ubuntu and it seems to be a command to manipulate routing
@Chex, thanks! On Ubuntu, I was getting an error trying to run ‘ip -a’, but your command worked — and it’s very useful info.
It was a typo on part.
However, ip link show should be used.
For wireless cards I find “iwconfig” useful. I used to have problems with a wireless adapter going offline, which I worked around with “iwconfig wlan0 power off” to turn off its power management feature.
It would be most useful to correlate the HW info to the logical device name, such as the Broadcom NIC is eth1.
Try ethtool or lspci it will map both along with driver name:
Writing a shell script left as an exercise for the reader.
At any point is this site going to post anything that isn’t basic common knowledge to any linux users that isnt a complete noob?
Because if not, then I’m going to unsubscribe from your RSS feed.
I can not stop you or anyone else from unsubscribing to our RSS feed. The /faq/ section is for new users only so it has all sort of questions and answers. As you may have noticed that I’ve already started to display the difficulty level for each Q & A. I’m also working on rss feed for all three difficulties. So that users can only subscribe as follows:
- Easy – for beginners.
- Moderate – for Intermediate users.
- Hard – for Advanced users.
This is going to take a little more time as need some sort of coding and modification on my part. Hope this helps.
ok, so idioms for the easy/intermediate/hard would be ubuntu/debian/all others? ^^
Nah, but linux is no longer for those who actually are bothered to learn how to use a computer (as opposed to the in ‘noob-land’), learn how to use windows. Now, many of the windows users who are just ‘end users’ and not computer savvy, migrate to linux, and will inadvertedly land on ubuntu like distros.
I recall on youtube, some user saying, I have been using Ubuntu for 6 months and consider myself fairly knowledgable, and then went on about DE if they are installable in other distros and what not. I don’t even know what it was, but it was so absurd, I am glad that person uttered Ubuntu and not linux, as clearly the person was clueless in the latter.
You can blame Canonical for such issue. Just visit http://www.ubuntu.com/desktop home page and try to find out word Linux. I think they are ashamed of using word Linux.
PS: I use Debian Linux 🙂
[updated] Various aspects of nixCraft can be monitored with RSS feeds including ability to sort out feed – https://www.cyberciti.biz/nixcraft-rss-feed-syndication/
Hope this helps!
@root
I don’t suppose you have noticed that at least 99% of the worlds population are at least some variant of a linux ‘noob’. It would indeed be pointless to run a web site for just the 1% who are whizz kids as you would have very few visitors indeed.
Also, I believe it should be ‘to any linux user who isn’t’
I’ve clearly lost the plot a little myself, ‘at least’ and ‘indeed’ twice in above comment. Have to stop taking these tablets.
In your scripts, the easiest way is to do something like this.
for x in `/sbin/ifconfig | grep Link | awk ‘
do
echo $x
done
Or you can /sbin/ifconfig $x | grep to extract and read the data into a variable to work on later.
Here is a small code you can use in your scripts.
for x in `/sbin/ifconfig | grep Link | awk ‘
do
echo $x
done
You can replace echo $x with
/sbin/ifconfig $x | grep (any property you are looking for) and read that into a variable.
I think some of the posts are not being accepted in the comments, Vivek. Not sure why. I thought first it was something in my browser.
I sure hope I didn’t have duplicates in the comments. 🙂
We cache page for 15 minutes. So you will not see updates immediately.
how to check the nic card settings in linux
What distro?
What specifics you are looking for?
If you mean network settings for each card, depending on your distro, it can be found at
For Redhat based distros
/etc/sysconfig/network-scripts/ifcfg-[device Name]
For Debian based distros
/etc/network/interfaces
For in depth, in detail information other settings about your network card, use ethtool.
Run
man ethtool
i have dell and i have wireless in my neighbours but shows me red cross so what i do please
I am new in linux.
now I have problem with my X-Server installation.
my machine used Red Hat V7,2
and my card is used AGX3281.
this is I did for replaced the old card, but I did with the same type.
after I finished the install the X-server, and run startx,
[root@barco1 root]# startx
xinit: No such file or directory (errno 2): no server “X” in PATH
Use the — option, or make sure that /usr/X11R6/bin is in your path and
that “X” is a program or a link to the right type of server
for your display. Possible server names include:
XFree86 XFree86 displays
giving up.
xinit: Connection refused (errno 111): unable to connect to X server
xinit: No such process (errno 3): Server error.
and when I start lspci
[root@barco1 root]# lspci
00:00.0 Host bridge: Intel Corp.: Unknown device 2770 (rev 02)
00:02.0 Display controller: Intel Corp.: Unknown device 2772 (rev 02)
00:1c.0 PCI bridge: Intel Corp.: Unknown device 27d0 (rev 01)
00:1c.1 PCI bridge: Intel Corp.: Unknown device 27d2 (rev 01)
00:1c.2 PCI bridge: Intel Corp.: Unknown device 27d4 (rev 01)
00:1c.3 PCI bridge: Intel Corp.: Unknown device 27d6 (rev 01)
00:1d.0 USB Controller: Intel Corp.: Unknown device 27c8 (rev 01)
00:1d.1 USB Controller: Intel Corp.: Unknown device 27c9 (rev 01)
00:1d.2 USB Controller: Intel Corp.: Unknown device 27ca (rev 01)
00:1d.3 USB Controller: Intel Corp.: Unknown device 27cb (rev 01)
00:1d.7 USB Controller: Intel Corp.: Unknown device 27cc (rev 01)
00:1e.0 PCI bridge: Intel Corp. 82801BAM PCI (rev e1)
00:1f.0 ISA bridge: Intel Corp.: Unknown device 27b8 (rev 01)
00:1f.2 IDE interface: Intel Corp.: Unknown device 27c0 (rev 01)
00:1f.3 SMBus: Intel Corp.: Unknown device 27da (rev 01)
0b:05.0 PCI bridge: Intel Corp.: Unknown device b154
0b:0b.0 Ethernet controller: Intel Corp. 82541PI Gigabit Ethernet Controller (re
v 05)
0c:00.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4c57
0c:01.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4c57
0c:02.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4c57
0c:03.0 VGA compatible controller: ATI Technologies Inc: Unknown device 4c57
0c:04.0 Host bridge: NEC Corporation Vrc5074 [Nile 4] (rev 03)
Источник
Linux hardware nic netxtreme
Introduction
Limitations
Packaging
Installing Linux Driver Software
Unloading/Removing the Linux Driver
Patching PCI Files (Optional)
Network Installations
Setting Values for Optional Properties
Driver Defaults
Driver Messages
Teaming with Channel Bonding
Statistics
Linux iSCSI Offload
Introduction
This section discusses the Linux drivers for the Broadcom NetXtreme II network adapters.
Limitations
bnx2 Driver
The current version of the driver has been tested on 2.4.x kernels (starting from 2.4.24) and all 2.6.x kernels. The driver may not compile on kernels older than 2.4.24.
NOTE: Support for the 2.4.21 kernels is provided in Red Hat Enterprise Linux 3.
Testing is concentrated on i386 and x86_64 architectures. Only limited testing has been done on other architectures. Minor changes to some source files and Makefile may be needed on some kernels. Additionally, the Makefile will not compile the cnic driver on kernels older than 2.6.16. iSCSI offload is only supported on 2.6.16 and newer kernels.
NOTE: For Broadcom NetXtreme II BCM5708 devices with a silicon revision prior to B2, the open source bnx2 driver does not support the reporting and configuration of NetXtreme II WOL settings via ethtool. For silicon revisions of B2 or later, the bnx2 driver reports support for Magic Packet WOL via ethtool. Enabling support via ethtool is mandatory to successfully wake the system. To determine the silicon revision of your Broadcom NetXtreme II device, use the lspci command, where «10» = revision B0, «11» = revision B1, and «12» = revision B2.
bnx2x Driver
The current version of the driver has been tested on 2.6.x kernels starting from 2.6.9. The driver may not compile on kernels older than 2.6.9. Testing is concentrated on i386 and x86_64 architectures. Only limited testing has been done on some other architectures. Minor changes to some source files and Makefile may be needed on some kernels.
bnx2i Driver
The current version of the driver has been tested on 2.6.x kernels, starting from 2.6.18 kernel. The driver may not compile on older kernels. Testing is concentrated on i386 and x86_64 architectures, Red Hat EL5, and SUSE 11 SP1 distributions.
Packaging
The Linux drivers are released in two packaging formats:
Identical source files to build the driver are included in both RPM and TAR source packages. The supplemental tar file contains additional utilities such as patches and driver diskette images for network installation.
The following is a list of included files:
netxtreme2- version .src.rpm: NetXtreme II bnx2/bnx2x/cnic/bnx2fc/bnx2ilibfc/libfcoe driver source RPM
netxtreme2- version .tar.gz: tar zipped NetXtreme II bnx2/bnx2x/cnic/bnx2fc/bnx2i/libfc/libfcoe driver source
The Linux driver has a dependency on open-fcoe userspace management tools as the front-end to control FCoE interfaces. The package name of the open-fcoe tool is fcoe-utils for RHEL 6.1 and open-fcoe for SLES11 SP1.
Installing Linux Driver Software
Installing the Source RPM Package
Building the Driver from the Source TAR File
NOTE: If a bnx2/bnx2x/bnx2i driver is loaded and the Linux kernel is updated, the driver module must be recompiled if the driver module was installed using the source RPM or the TAR package.
Installing the Source RPM Package
The following are guidelines for installing the driver source RPM Package.
Note that the —force option may be needed on some Linux distributions if conflicts are reported.
For RHEL 6.1, either of the following:
For RHEL 6.2 and SLES11 SP2, the version of fcoe-utils/open-fcoe included in your distribution is sufficient and no out of box upgrades are provided.
Where available, installation with yum will automatically resolve dependencies. Otherwise, required dependencies can be located on your O/S installation media.
NOTE: Note that your distribution might have a different naming scheme for Ethernet devices. (i.e. pXpX or emX instead of ethX).
For SLES11 SP1, RHEL 6.1, RHEL 6.2:
For SLES11 SP1, RHEL 6.1, RHEL 6.2:
Installing the KMP Package
NOTE: The examples in this procedure refer to the bnx2x driver, but also apply to the bnx2 and bnx2i drivers.
Building the Driver from the Source TAR File
NOTE: The examples used in this procedure refer to the bnx2 driver, but also apply to the bnx2x driver.
Verify that your network adapter supports iSCSI by checking the message log. If the message «bnx2i: dev eth0 does not support iSCSI» appears in the message log after loading the bnx2i driver, then iSCSI is not supported. This message may not appear until the interface is opened, as with:
NOTE: See the RPM instructions above for the location of the installed driver.
Refer to ifconfig eth0 upLoad and Run Necessary iSCSI Software Components for instructions on loading the software components required to use the Broadcom iSCSI offload feature.
To configure the network protocol and address after building the driver, refer to the manuals supplied with your operating system.
Verify that your network adapter supports iSCSI by checking the message log. If the message «bnx2i: dev eth0 does not support iSCSI» appears in the message log after loading the bnx2i driver, then iSCSI is not supported. This message may not appear until the interface is opened, as with:
ifconfig eth0 up Load and Run Necessary iSCSI Software Components
The Broadcom iSCSI Offload software suite consists of three kernel modules and a user daemon. Required software components can be loaded either manually or through system services.
Источник