[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to find out ethernet device name



On Wed 18 Apr 2018 at 12:13:31 -0000, Dan Purgert wrote:

> Ben Caradoc-Davies wrote:
> > On 18/04/18 09:46, Don Armstrong wrote:
> >> On Tue, 17 Apr 2018, Long Wind wrote:
> >>> we used to call them eth0, eth1 ...now we use new names
> >>> i have a ethernet card in stretchhow to find out its name? Thanks!
> >> sudo ip link;
> >> will show you what the available interface names are.
> >
> > And if you want the old style (eth0, eth1, wlan0, ...) interface names 
> > that are not generated from the hardware MAC address, append the kernel 
> > command line parameter net.ifnames=0 to GRUB_CMDLINE_LINUX in 
> > /etc/default/grub, run update-grub, and restart.
> 
> or just set a udev rule.

Or follow the advice here:

https://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/2018-February/016755.html

No, but you can setup your own naming scheme, matching on whatever you
see fit, including the MAC address.
Say I wanted to name my ethernet device net0, then you could setup
something like

$ cat /etc/systemd/network/70-net.link
[Match]
MACAddress=3D00:11:22:33:44:55:66

[Link]
Name=3Dnet0

If you are going to rename network interfaces, don't reuse the kernel
provided names, i.e. ethX and wlanX, as this is inherently racy.

See man systemd.link for more information on this.

If you are sure, that your system will only ever have a single network
interface, you can also disable the new default network interface naming
scheme and use the kernel provided names. See
/usr/share/doc/udev/README.Debian.gz =E2=86=92 "Network interface naming"=


Let me repeat: Using the kernel provided names is probably only a good
idea if you have a single network interface. With multiple interfaces,
you have no guarantee in which order they are enumerated and named.

I'm closing this bug report, as unfortunately there is nothing really
that systemd/udev can do, if your bios update has such effects.

Regards,
Michael


Reply to: