
and subsidiaries NetXtreme BCM5720 Gigabit Ethernet PCIeĠ4:00.1 Ethernet controller: Broadcom Inc. I'll leave this open in case someone comes up with something cleaner but what I ended up doing was combining lspci and ethtool: ~]# lspci -v | grep EthernetĠ4:00.0 Ethernet controller: Broadcom Inc. So you could easily extend that to: $ ( cd /sys/class/net/ & for i in * do printf '%s: %s\n' "$i" $(cat "$i"/address) done )īut really, parsing the output of the ip command given by Marcus Müller is your best bet: $ ip link | awk '$1~/^*:/'" You can get all MAC addresses of your network cards with: $ cat /sys/class/net/*/address There's no "not much shell logic" way of mapping Linux network interfaces to "device names" (like your "NIC 1 - Intel x710"), especially in the context of things like multi-port SFP+ cards like the x710 these are designed to offer virtual functions, so the mapping of "one Linux network device belongs to one hardware device" simply works in neither direction. Link/ether 00:01:02:03:04:05 brd ff:ff:ff:ff:ff:ffĤ: virbr0: mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000 Link/ether aa:aa:bb:bb:cc:dd brd ff:ff:ff:ff:ff:ffģ: enp1s0: mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 Mine looks roughly like 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
