Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Fri Dec 01, 2023 12:44 am


System administration, processes administration, jobs, cron, resources, limits, shells, ssh, telnet.

Author Message
mandrei99
Post  Post subject: How to identify each ethX device in Linux to what dual or quad port interface card it belongs to  |  Posted: Mon Jul 22, 2013 10:08 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 250

Offline
 

How to identify each ethX device in Linux to what dual or quad port interface card it belongs to

As described in a previous post http://forum.ivorde.ro/how-to-list-pci-devices-in-linux-lspci-t14791.html, you can use the lspci command to list all pci devices under a Linux server.

To find the PCI bus address of each ethernet device, find the devices in the kernel pseudo filesystem /sys and map them against the output from lspci.

How to find PCI bus address of all the ethernet devices in a Linux server
Code:
# ip a l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:30:48:d0:2f:f9 brd ff:ff:ff:ff:ff:ff
    inet 172.30.72.230/23 brd 172.30.73.255 scope global eth0
    inet6 fe80::230:48ff:fed0:2ff9/64 scope link
       valid_lft forever preferred_lft forever
4: eth7: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:e0:ed:13:33:c6 brd ff:ff:ff:ff:ff:ff
5: eth6: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:e0:ed:13:33:c7 brd ff:ff:ff:ff:ff:ff
6: eth11: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:e0:ed:13:33:d6 brd ff:ff:ff:ff:ff:ff
7: eth10: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:e0:ed:13:33:d7 brd ff:ff:ff:ff:ff:ff
8: eth9: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:e0:ed:13:33:e4 brd ff:ff:ff:ff:ff:ff
9: eth8: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:e0:ed:13:33:e5 brd ff:ff:ff:ff:ff:ff
10: eth5: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:30:48:5f:d2:90 brd ff:ff:ff:ff:ff:ff
11: eth4: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:30:48:5f:d2:91 brd ff:ff:ff:ff:ff:ff
12: eth3: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:30:48:5f:d2:92 brd ff:ff:ff:ff:ff:ff
13: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:30:48:5f:d2:93 brd ff:ff:ff:ff:ff:ff
14: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:30:48:d0:2f:f8 brd ff:ff:ff:ff:ff:ff


Code:
#  lspci -tv
-[0000:00]-+-00.0  Intel Corporation 5400 Chipset Memory Controller Hub
           +-01.0-[0000:01]--+-00.0  Intel Corporation 82598EB 10 Gigabit AF Dual Port Network Connection
           |                 \-00.1  Intel Corporation 82598EB 10 Gigabit AF Dual Port Network Connection
           +-03.0-[0000:11]--+-00.0  Intel Corporation 82598EB 10 Gigabit AF Dual Port Network Connection
           |                 \-00.1  Intel Corporation 82598EB 10 Gigabit AF Dual Port Network Connection
           +-05.0-[0000:21]--+-00.0  Intel Corporation 82598EB 10 Gigabit AF Dual Port Network Connection
           |                 \-00.1  Intel Corporation 82598EB 10 Gigabit AF Dual Port Network Connection
           +-07.0-[0000:31-34]----00.0-[0000:32-34]--+-01.0-[0000:33]--+-00.0  Intel Corporation 82575EB Gigabit Network Connection
           |                                         |                 \-00.1  Intel Corporation 82575EB Gigabit Network Connection
           |                                         \-02.0-[0000:34]--+-00.0  Intel Corporation 82575EB Gigabit Network Connection
           |                                                           \-00.1  Intel Corporation 82575EB Gigabit Network Connection
           +-09.0-[0000:41-52]--+-00.0-[0000:42-51]--+-00.0-[0000:43]--
           |                    |                    \-02.0-[0000:51]--+-00.0  Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper)
           |                    |                                      \-00.1  Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper)
           |                    \-00.3-[0000:52]--
           +-0f.0  Intel Corporation 5400 Chipset QuickData Technology Device
           +-10.0  Intel Corporation 5400 Chipset FSB Registers
           +-10.1  Intel Corporation 5400 Chipset FSB Registers
           +-10.2  Intel Corporation 5400 Chipset FSB Registers
           +-10.3  Intel Corporation 5400 Chipset FSB Registers
           +-10.4  Intel Corporation 5400 Chipset FSB Registers
           +-11.0  Intel Corporation 5400 Chipset CE/SF Registers
           +-15.0  Intel Corporation 5400 Chipset FBD Registers
           +-15.1  Intel Corporation 5400 Chipset FBD Registers
           +-16.0  Intel Corporation 5400 Chipset FBD Registers
           +-16.1  Intel Corporation 5400 Chipset FBD Registers
           +-1d.0  Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #1
           +-1d.1  Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #2
           +-1d.2  Intel Corporation 631xESB/632xESB/3100 Chipset UHCI USB Controller #3
           +-1d.7  Intel Corporation 631xESB/632xESB/3100 Chipset EHCI USB2 Controller
           +-1e.0-[0000:53]----01.0  ATI Technologies Inc ES1000
           +-1f.0  Intel Corporation 631xESB/632xESB/3100 Chipset LPC Interface Controller
           +-1f.1  Intel Corporation 631xESB/632xESB IDE Controller
           +-1f.2  Intel Corporation 631xESB/632xESB SATA AHCI Controller
           \-1f.3  Intel Corporation 631xESB/632xESB/3100 Chipset SMBus Controller


Code:
# find /sys/devices/ -name "eth*"
/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/eth7
/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/net/eth6
/sys/devices/pci0000:00/0000:00:03.0/0000:11:00.0/net/eth11
/sys/devices/pci0000:00/0000:00:03.0/0000:11:00.1/net/eth10
/sys/devices/pci0000:00/0000:00:05.0/0000:21:00.0/net/eth9
/sys/devices/pci0000:00/0000:00:05.0/0000:21:00.1/net/eth8
/sys/devices/pci0000:00/0000:00:07.0/0000:31:00.0/0000:32:01.0/0000:33:00.0/net/eth5
/sys/devices/pci0000:00/0000:00:07.0/0000:31:00.0/0000:32:01.0/0000:33:00.1/net/eth4
/sys/devices/pci0000:00/0000:00:07.0/0000:31:00.0/0000:32:02.0/0000:34:00.0/net/eth3
/sys/devices/pci0000:00/0000:00:07.0/0000:31:00.0/0000:32:02.0/0000:34:00.1/net/eth2
/sys/devices/pci0000:00/0000:00:09.0/0000:41:00.0/0000:42:02.0/0000:51:00.0/net/eth1
/sys/devices/pci0000:00/0000:00:09.0/0000:41:00.0/0000:42:02.0/0000:51:00.1/net/eth0


This is useful to identify each "ethX" device in Linux to what quad , dual or single port interface card it belongs to.





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "How to identify each ethX device in Linux to what dual or quad port interface card it belongs to"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to check if ssh/http daemon listens on TCP port in Linux using lsof & netstat

mandrei99

0

13202

Mon Oct 17, 2011 9:17 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux network interface pci slot information - lspci / Intel or Broadcom

mandrei99

0

11502

Fri Jan 16, 2015 7:58 pm

mandrei99 View the latest post

There are no new unread posts for this topic. How to check if ssh/http daemon listens on TCP port in FreeBSD using sockstat & lsof & netstat util

mandrei99

0

3425

Mon Oct 17, 2011 9:27 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to list PCI devices in Linux - lspci

mandrei99

0

4068

Mon Jul 22, 2013 10:03 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux clear screen / terminal

mandrei99

2

9134

Wed Mar 04, 2015 8:52 am

Guest View the latest post

There are no new unread posts for this topic. Linux: List kernel supported filesystems

debuser

0

2306

Tue Mar 10, 2015 5:45 pm

debuser View the latest post

There are no new unread posts for this topic. Linux: list block devices UUID

debuser

0

3707

Tue Mar 10, 2015 5:46 pm

debuser View the latest post

There are no new unread posts for this topic. How to prevent Linux SSH client from disconnecting using ServerAliveInterval

mandrei99

0

32307

Fri Jan 09, 2015 8:26 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Change default editor to VI in Debian Linux

mandrei99

0

2590

Fri Jan 16, 2015 6:59 pm

mandrei99 View the latest post

There are no new unread posts for this topic. How to print filesystem super block information in Linux

mandrei99

0

14101

Mon Jul 08, 2013 6:56 am

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO