Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Default network interface name

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Default network interface name

#1 Post by L_V »

Hello,

After reading this interesting network investigation, I wonder what is the origin of the default network name created during installation (eth0 / wlan0 / enp2s0 etc etc....).

It seems that the root is file /usr/lib/systemd/network/99-default.link which contains:

Code: Select all

[Link]
NamePolicy=kernel database onboard slot path
MACAddressPolicy=persistent
The network name should come from kernel or udev.

Is there a command to generate this default network name ?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Default network interface name

#2 Post by Head_on_a_Stick »

deadbang

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Default network interface name

#3 Post by L_V »

This does not answer the question, but thank you anyway.

The question is: Is there a command to generate this default network name ?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Default network interface name

#4 Post by Head_on_a_Stick »

I do not understand your question then, sorry.

The old naming scheme is enforced by 70-local-persistent-net.rules in jessie, is that what you mean?
deadbang

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Default network interface name

#5 Post by Head_on_a_Stick »

L_V wrote:Is there a command to generate this default network name ?

Code: Select all

ip link
EDIT: also, you can work out what the name will be from the location of the PCI slot on the motherboard before even connecting a card.
deadbang

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Default network interface name

#6 Post by L_V »

No. ip link will give you the name of your already configured network interface.

Before creating any connection, the system creates a default network name.
The question is: how the system creates and decides this name, ie, with which command.
Last edited by L_V on 2017-11-30 19:35, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Default network interface name

#7 Post by Head_on_a_Stick »

L_V wrote:how the system creates and decides this name
My Debian wiki link states that:
it relies on the BIOS enumeration
But I really don't know, sorry.
deadbang

shep
Posts: 423
Joined: 2011-03-15 15:22

Re: Default network interface name

#8 Post by shep »

Debian 8 used wireless tools while Debian 9 uses iw. See this Arch Linux wiki
https://wiki.archlinux.org/index.php/Wi ... _interface
Last edited by shep on 2017-11-30 23:10, edited 1 time in total.

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Default network interface name

#9 Post by L_V »

Instead of reporting links (that I know, but did not help to come to conclusion), can you summarize in one line which command creates the default system network name, before being able to configure this network interface ?

I am afraid I will not find the answer, but anyway, I can try an easier question.
If you read this interesting investigation [ here ], you will read that the first command used is "ifconfig wlan0 up".
This was relevant in 2012, when there was no real question on network name (usually eth0 for Debian).

But now you don't know which default network name will be created, "ifconfig wlan0 up" is now "ifconfig xxxx up", and you first need to replace xxxx by something the system will understand.
How xxxx can be known, before configuring anything ?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Default network interface name

#10 Post by Head_on_a_Stick »

L_V wrote:How xxxx can be known, before configuring anything ?
The interface name is set by the kernel during the boot process before any configuration is done.

Check the output of `journalctl -b` (as root) to see it happen.

The "manual" instructions in your link will work just fine if you replace "wlan0" with "wlp2s0" (or whatever).
deadbang

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Default network interface name

#11 Post by L_V »

Although I did not find the command which creates this default name, I think at least the result can be found here:

Code: Select all

 ls /sys/class/net/
which will give lo and xxx , xxx being this default network name.

shep
Posts: 423
Joined: 2011-03-15 15:22

Re: Default network interface name

#12 Post by shep »

L_V wrote:Instead of reporting links (that I know, but did not help to come to conclusion), can you summarize in one line which command creates the default system network name, before being able to configure this network interface ?
The commands changed between Debian 8 and Debian 9 and I cannot tell from your prior posts which version you are using.

Spoon feed:

"ifconfig/iwconfig" for Debian 8
"iw dev/ls /sys/class/net/ip link" for Debian 9.

Each of these commands has a manual page and the Arch Wiki link has the command spelled out for you.

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Default network interface name

#13 Post by L_V »

shep wrote:"iw dev/ls /sys/class/net/ip link" for Debian 9.
I use Debian 9, but sorry to say I am quite sure you are probably wrong for a simple reason: iw is not installed during a netinstall, and the network always works fine after reboot, based on /etc/network/interfaces configuration and ifupdown tool (this is true for Debian, but not for all....).
And iw is only for wireless configuration !

An other assumption is that the Debian installation script is creating this default network name, bounded to the MAC address of the network card and PCI position.
example:

Code: Select all

ls -l /sys/class/net/
/sys/class/net/enp2s0 -> ../../devices/pci0000:00/0000:00:05.0/0000:02:00.0/net/enp2s0
To be noted that Debian 9 still installs ifconfig (from net-tools package) + ifupdown tools as default network configuration tools, but systemd is able to configure by itself the network starting from /usr/lib/systemd/network/99-default.link which is likely parameters used by a script to create the default network name.
see man { systemd.network, systemd.link, systemd-networkd.service, systemd.netdev, systemd-resolved.service }

ifupdown is not necessary anymore in Debian 9, and I investigate what can be cleaned up to avoid redundancy/conflict of network tools which is quite hard to understand (DNS / resolv / symlinks between network configuration tools..... ).
Last edited by L_V on 2017-12-01 09:04, edited 1 time in total.

shep
Posts: 423
Joined: 2011-03-15 15:22

Re: Default network interface name

#14 Post by shep »

L_V wrote:I use Debian 9, but sorry to say I am quite sure you are probably wrong for a simple reason: iw is not installed during a netinstall, and the network always works fine after reboot, based on /etc/network/interfaces configuration and ifupdown tool (this is true for Debian, but not for all....).
And iw is only for wireless configuration !
If debian 9 detects a wireless card during installation, it will install wpa_supplicant and iw. If you you the non-free firmware install image, it will also install the firmware.

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Default network interface name

#15 Post by L_V »

wizard10000 wrote: I would suggest you give the article another look.
No, seriously ? Again ?
As you did not understand the question raised, I would suggest you give my fist message another look.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Default network interface name

#16 Post by GarryRicketson »

This post was made by L_V who is currently on your ignore list. Display this post.
Nah. No longer interested.
I lost interest a long time ago :mrgreen:

Post Reply