Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The meaning of the /sys/class/net/<interface>/type value

Tags:

linux

For each network interface linux contains a directory in /sys/class/net There is a file with name "type". Its value is: 1 - for wlan0/eth0. 772 - for lo. 512 - for rmnet0/rmnet1/...

So what is the meaning of these values? Where can I find any descriptions?

like image 466
Zyoma Avatar asked Sep 03 '13 17:09

Zyoma


1 Answers

This header will show you the way to the world of work with interfaces:

https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/if_arp.h#L30

There are many, but the most common:

#define ARPHRD_ETHER    1       /* Ethernet 10Mbps      */
#define ARPHRD_LOOPBACK 772     /* Loopback device      */
like image 108
Evgen Druzhynin Avatar answered Oct 01 '22 19:10

Evgen Druzhynin