[solved] Raspbian Stretch: how to identify built-in ethernet adapter
Posted: Thu Aug 17, 2017 7:24 pm
i have a problem with Raspbian Stretch (2017-07-05-raspbian-jessie.img).
with Raspbian/Debian Stretch the method of naming network adapters has changes.
on Raspbian Jessie the built-in ethernet adapter got always the name eth0.
on Raspbian Stretch the built-in ethernet adapter get a name with the MAC address in it (e.g. enx112233445566).
but this makes it impossible for scripts to find the built-in ehternet adapter without the knowledge of the MAC of that adapter.
in the past, i simply could grab necessary information by using the name eth0.
how can i identify the built-in ethernet adapter without knowing the MAC address and existence of multiple ethernet adapters at the same time.
e.g.how can the script find out which of the listed adapters is the built-in adapter of the RPi, when the MAC address is unknown by the script?
(the script is running on different RPis - so i can not hardcode the MAC or adapter name)
PS.: i am not able to do any preparations before the script is running. the script has to work out of the box on each RPi.
with Raspbian/Debian Stretch the method of naming network adapters has changes.
on Raspbian Jessie the built-in ethernet adapter got always the name eth0.
on Raspbian Stretch the built-in ethernet adapter get a name with the MAC address in it (e.g. enx112233445566).
but this makes it impossible for scripts to find the built-in ehternet adapter without the knowledge of the MAC of that adapter.
in the past, i simply could grab necessary information by using the name eth0.
how can i identify the built-in ethernet adapter without knowing the MAC address and existence of multiple ethernet adapters at the same time.
e.g.
Code: Select all
pi@raspberry:~ $ ifconfig
enx112233445566: ...
enx998877665544: ...
enx556677889900: ...
lo: ...
(the script is running on different RPis - so i can not hardcode the MAC or adapter name)
PS.: i am not able to do any preparations before the script is running. the script has to work out of the box on each RPi.