Naming convention standard for Ethernet and wifi interfaces in linux machines
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I would like to know what is the naming convention standard for Ethernet and Wifi interfaces in linux machine.
we are developing a tool that should show only the Ethernet and wifi interface of the linux machine and its current status.
For ex, below are the list of network interfaces(both physical and virtual) in my linux(ubuntu) machine.
docker0, enp0s25, lo, wlp3s0
When I run the tool, below is the result I will be getting.
enp0s25, wlp3s0
we have written the code with the logic that all the ethernet interface always starts with word e and wifi interfaces always starts with word w.
Is the logic right, if not how can we address this?
networking wifi network-interface ethernet
add a comment |Â
up vote
1
down vote
favorite
I would like to know what is the naming convention standard for Ethernet and Wifi interfaces in linux machine.
we are developing a tool that should show only the Ethernet and wifi interface of the linux machine and its current status.
For ex, below are the list of network interfaces(both physical and virtual) in my linux(ubuntu) machine.
docker0, enp0s25, lo, wlp3s0
When I run the tool, below is the result I will be getting.
enp0s25, wlp3s0
we have written the code with the logic that all the ethernet interface always starts with word e and wifi interfaces always starts with word w.
Is the logic right, if not how can we address this?
networking wifi network-interface ethernet
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I would like to know what is the naming convention standard for Ethernet and Wifi interfaces in linux machine.
we are developing a tool that should show only the Ethernet and wifi interface of the linux machine and its current status.
For ex, below are the list of network interfaces(both physical and virtual) in my linux(ubuntu) machine.
docker0, enp0s25, lo, wlp3s0
When I run the tool, below is the result I will be getting.
enp0s25, wlp3s0
we have written the code with the logic that all the ethernet interface always starts with word e and wifi interfaces always starts with word w.
Is the logic right, if not how can we address this?
networking wifi network-interface ethernet
I would like to know what is the naming convention standard for Ethernet and Wifi interfaces in linux machine.
we are developing a tool that should show only the Ethernet and wifi interface of the linux machine and its current status.
For ex, below are the list of network interfaces(both physical and virtual) in my linux(ubuntu) machine.
docker0, enp0s25, lo, wlp3s0
When I run the tool, below is the result I will be getting.
enp0s25, wlp3s0
we have written the code with the logic that all the ethernet interface always starts with word e and wifi interfaces always starts with word w.
Is the logic right, if not how can we address this?
networking wifi network-interface ethernet
networking wifi network-interface ethernet
edited 1 hour ago
Rui F Ribeiro
37.9k1475121
37.9k1475121
asked 3 hours ago
Mohan Raj
61
61
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
The naming convention is that LAN interfaces are named eth0
, eth1
, ... and that WLAN interfaces are named wlan0
, wlan1
, ...
What you see are the so called "predictable names" that systemd introduced. In practice, they are anything but predictable, and they can even change when the hardware is changed, which is exactly the problem they are supposed to avoid.
For a guess the start letter may be good enough. Some interfaces, in particular WLAN, have hints in /sys/class/net/*/uevent
:
DEVTYPE=wlan
Unfortunately, there is no such DEVTYPE
for LAN interfaces.
add a comment |Â
up vote
2
down vote
For systemd predictable interface names, the prefixes can be seen in udev-builtin-net_id.c
:
* Two character prefixes based on the type of interface:
* en — Ethernet
* ib — InfiniBand
* sl — serial line IP (slip)
* wl — wlan
* ww — wwan
so for both the traditional ethX
style of naming and the newer systemd naming, an initial letter e should be an ethernet interface for any automatically generated interface names. All wifi interfaces should begin with a w in both schemes, although not all interfaces beginning with w will be wifi.
If this tool has to work in an arbitrary environment (rather than just on internal environments which you control), note that users may rename interfaces on linux systems with arbitrary names, such as [wan0
, lan0
, lan1
, dmz0
] which will break any assumptions about initial letters.
add a comment |Â
up vote
1
down vote
Network interfaces can be named anything, so no matter what you do, you'll run into situations where (1) there is a "physical" network interface with a name that didn't match your pattern, or (2) there is a "physical" network interface that will match your pattern.
On top of that, if I was a user of your tool, the moment your tool wouldn't allow me to do something I want, because I have a network interface which is "virtual", though for practical purposes it should be considered "physical" in my setup, I'd start cursing loudly and forcefully at your app, and won't ever use it again.
Physical and virtual network interfaces all share a common API are one thing which makes Linux really flexible. Please don't try to babysit your user, and take that away from him or her. Your users will thank you.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
The naming convention is that LAN interfaces are named eth0
, eth1
, ... and that WLAN interfaces are named wlan0
, wlan1
, ...
What you see are the so called "predictable names" that systemd introduced. In practice, they are anything but predictable, and they can even change when the hardware is changed, which is exactly the problem they are supposed to avoid.
For a guess the start letter may be good enough. Some interfaces, in particular WLAN, have hints in /sys/class/net/*/uevent
:
DEVTYPE=wlan
Unfortunately, there is no such DEVTYPE
for LAN interfaces.
add a comment |Â
up vote
2
down vote
The naming convention is that LAN interfaces are named eth0
, eth1
, ... and that WLAN interfaces are named wlan0
, wlan1
, ...
What you see are the so called "predictable names" that systemd introduced. In practice, they are anything but predictable, and they can even change when the hardware is changed, which is exactly the problem they are supposed to avoid.
For a guess the start letter may be good enough. Some interfaces, in particular WLAN, have hints in /sys/class/net/*/uevent
:
DEVTYPE=wlan
Unfortunately, there is no such DEVTYPE
for LAN interfaces.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
The naming convention is that LAN interfaces are named eth0
, eth1
, ... and that WLAN interfaces are named wlan0
, wlan1
, ...
What you see are the so called "predictable names" that systemd introduced. In practice, they are anything but predictable, and they can even change when the hardware is changed, which is exactly the problem they are supposed to avoid.
For a guess the start letter may be good enough. Some interfaces, in particular WLAN, have hints in /sys/class/net/*/uevent
:
DEVTYPE=wlan
Unfortunately, there is no such DEVTYPE
for LAN interfaces.
The naming convention is that LAN interfaces are named eth0
, eth1
, ... and that WLAN interfaces are named wlan0
, wlan1
, ...
What you see are the so called "predictable names" that systemd introduced. In practice, they are anything but predictable, and they can even change when the hardware is changed, which is exactly the problem they are supposed to avoid.
For a guess the start letter may be good enough. Some interfaces, in particular WLAN, have hints in /sys/class/net/*/uevent
:
DEVTYPE=wlan
Unfortunately, there is no such DEVTYPE
for LAN interfaces.
answered 3 hours ago
RalfFriedl
4,6061725
4,6061725
add a comment |Â
add a comment |Â
up vote
2
down vote
For systemd predictable interface names, the prefixes can be seen in udev-builtin-net_id.c
:
* Two character prefixes based on the type of interface:
* en — Ethernet
* ib — InfiniBand
* sl — serial line IP (slip)
* wl — wlan
* ww — wwan
so for both the traditional ethX
style of naming and the newer systemd naming, an initial letter e should be an ethernet interface for any automatically generated interface names. All wifi interfaces should begin with a w in both schemes, although not all interfaces beginning with w will be wifi.
If this tool has to work in an arbitrary environment (rather than just on internal environments which you control), note that users may rename interfaces on linux systems with arbitrary names, such as [wan0
, lan0
, lan1
, dmz0
] which will break any assumptions about initial letters.
add a comment |Â
up vote
2
down vote
For systemd predictable interface names, the prefixes can be seen in udev-builtin-net_id.c
:
* Two character prefixes based on the type of interface:
* en — Ethernet
* ib — InfiniBand
* sl — serial line IP (slip)
* wl — wlan
* ww — wwan
so for both the traditional ethX
style of naming and the newer systemd naming, an initial letter e should be an ethernet interface for any automatically generated interface names. All wifi interfaces should begin with a w in both schemes, although not all interfaces beginning with w will be wifi.
If this tool has to work in an arbitrary environment (rather than just on internal environments which you control), note that users may rename interfaces on linux systems with arbitrary names, such as [wan0
, lan0
, lan1
, dmz0
] which will break any assumptions about initial letters.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
For systemd predictable interface names, the prefixes can be seen in udev-builtin-net_id.c
:
* Two character prefixes based on the type of interface:
* en — Ethernet
* ib — InfiniBand
* sl — serial line IP (slip)
* wl — wlan
* ww — wwan
so for both the traditional ethX
style of naming and the newer systemd naming, an initial letter e should be an ethernet interface for any automatically generated interface names. All wifi interfaces should begin with a w in both schemes, although not all interfaces beginning with w will be wifi.
If this tool has to work in an arbitrary environment (rather than just on internal environments which you control), note that users may rename interfaces on linux systems with arbitrary names, such as [wan0
, lan0
, lan1
, dmz0
] which will break any assumptions about initial letters.
For systemd predictable interface names, the prefixes can be seen in udev-builtin-net_id.c
:
* Two character prefixes based on the type of interface:
* en — Ethernet
* ib — InfiniBand
* sl — serial line IP (slip)
* wl — wlan
* ww — wwan
so for both the traditional ethX
style of naming and the newer systemd naming, an initial letter e should be an ethernet interface for any automatically generated interface names. All wifi interfaces should begin with a w in both schemes, although not all interfaces beginning with w will be wifi.
If this tool has to work in an arbitrary environment (rather than just on internal environments which you control), note that users may rename interfaces on linux systems with arbitrary names, such as [wan0
, lan0
, lan1
, dmz0
] which will break any assumptions about initial letters.
edited 1 hour ago
answered 2 hours ago
user4556274
5,07811123
5,07811123
add a comment |Â
add a comment |Â
up vote
1
down vote
Network interfaces can be named anything, so no matter what you do, you'll run into situations where (1) there is a "physical" network interface with a name that didn't match your pattern, or (2) there is a "physical" network interface that will match your pattern.
On top of that, if I was a user of your tool, the moment your tool wouldn't allow me to do something I want, because I have a network interface which is "virtual", though for practical purposes it should be considered "physical" in my setup, I'd start cursing loudly and forcefully at your app, and won't ever use it again.
Physical and virtual network interfaces all share a common API are one thing which makes Linux really flexible. Please don't try to babysit your user, and take that away from him or her. Your users will thank you.
add a comment |Â
up vote
1
down vote
Network interfaces can be named anything, so no matter what you do, you'll run into situations where (1) there is a "physical" network interface with a name that didn't match your pattern, or (2) there is a "physical" network interface that will match your pattern.
On top of that, if I was a user of your tool, the moment your tool wouldn't allow me to do something I want, because I have a network interface which is "virtual", though for practical purposes it should be considered "physical" in my setup, I'd start cursing loudly and forcefully at your app, and won't ever use it again.
Physical and virtual network interfaces all share a common API are one thing which makes Linux really flexible. Please don't try to babysit your user, and take that away from him or her. Your users will thank you.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Network interfaces can be named anything, so no matter what you do, you'll run into situations where (1) there is a "physical" network interface with a name that didn't match your pattern, or (2) there is a "physical" network interface that will match your pattern.
On top of that, if I was a user of your tool, the moment your tool wouldn't allow me to do something I want, because I have a network interface which is "virtual", though for practical purposes it should be considered "physical" in my setup, I'd start cursing loudly and forcefully at your app, and won't ever use it again.
Physical and virtual network interfaces all share a common API are one thing which makes Linux really flexible. Please don't try to babysit your user, and take that away from him or her. Your users will thank you.
Network interfaces can be named anything, so no matter what you do, you'll run into situations where (1) there is a "physical" network interface with a name that didn't match your pattern, or (2) there is a "physical" network interface that will match your pattern.
On top of that, if I was a user of your tool, the moment your tool wouldn't allow me to do something I want, because I have a network interface which is "virtual", though for practical purposes it should be considered "physical" in my setup, I'd start cursing loudly and forcefully at your app, and won't ever use it again.
Physical and virtual network interfaces all share a common API are one thing which makes Linux really flexible. Please don't try to babysit your user, and take that away from him or her. Your users will thank you.
answered 1 hour ago
dirkt
15.4k21132
15.4k21132
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479094%2fnaming-convention-standard-for-ethernet-and-wifi-interfaces-in-linux-machines%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password