Sample Header Ad - 728x90

Identifying physical network devices using /sys/class/net/<iface>

2 votes
2 answers
3600 views
I wanted to know if there is a way to differentiate physical and virtual network devices. ip a doesn't have an option. So I am trying /sys/class/net/. There are 2 attributes addr_assign_type and type, but type only tells Ethernet or loopback there is not way to tell if its virtual. I wanted to know does addr_assign_type tell us the different? As per my observation /sys/class/net//{eth|loopback} gives 0 and /sys/class/net//{virtualdevice} gives 1 or 3. Is there something I can infer from this?
Asked by Dinesh Gowda (121 rep)
Jul 24, 2019, 08:05 AM
Last activity: Jun 28, 2025, 05:06 AM