Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 466262 - Update handbook for the predictable network interface names
Summary: Update handbook for the predictable network interface names
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Installation Handbook (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
: 451950 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-17 17:43 UTC by Samuli Suominen (RETIRED)
Modified: 2013-06-12 17:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuli Suominen (RETIRED) gentoo-dev 2013-04-17 17:43:04 UTC
Some of the text I wrote for the handbook, but I'm not sure howto embed it there and in which pages. The net.ifnames=0 option thingy to bootloader config page? grep eth0, grep ifconfig, and such reveals quite a many .xml pages in the handbooks CVS directory. For example,
hb-install-network.xml mentions if machine has multiple cards, then names like eth0, eth1, eth2 will be used, but this isn't true anymore with current /dev manager udev.

The text, propably with a lot of grammar errors:

The default /dev manager udev will rename the interfaces based on the cards
attributes using the order defined in file <path>/lib/udev/rules.d/80-net-name-slot.rules</path>.
First ID_NET_NAME_ONBOARD (like <e>eno0</e>), second ID_NET_NAME_SLOT (like ens1),
and third ID_NET_NAME_PATH (like <e>enp1s0</e>). If none of these three attributes are
available then the fallback is used, which is kernel names (like <e>eth0</e>).
You can use the following command for finding out the attributes of your card,
but look inside the /sys/class/net/ directory first because <e>eth0</e> is only a
example here like in rest of the document:
# <i>udevadm test-builtin net_id /sys/class/net/eth0 2> /dev/null</i>

This feature can be disabled completely with the kernel option <c>net.ifnames=0</c> in the
bootloaders config or by creating empty <path>/etc/udev/rules.d/80-net-name-slot.rules</path>
to override the copy in <path>/lib/udev/rules/80-net-name-slot.rules</path>.
Then kernel names would always be used and udev wouldn't handle network interface names anymore.

Remember you can always use MAC based custom rules or enx* namespaced addresses
(like enx78e7d1ea46dc) by copying <path>/lib/udev/rules.d/80-net-name-slot.rules</path>
to <path>/etc/udev/rules.d/</path> and modifying it there to pick up ID_NET_NAME_MAC
attributes first.
However if you choose to write your own rules to get consistent network interface
names you should know you can't rename into kernel reserved names with udev,
so you can use something like <e>lan0</e> instead of <e>eth0</e> for renaming hem.

Make sure that the network card you want to use works well and remember to use
the correct naming throughout this document. We will assume that the network card
<e>eth0</e> is used because none of the three earlier mentioned  attributes were
available.
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2013-04-17 17:45:55 UTC
--- hb-install-network.xml
+++ hb-install-network.xml
@@ -315,9 +315,8 @@
 </pre>
 
 <p>
-If you have multiple network cards in your system they are named <e>eth0</e>,
-<e>eth1</e>, etc. Make sure that the network card you want to use works well and
-remember to use the correct naming throughout this document. We will assume that
+Make sure that the network card you want to use works well and remember to
+use the correct naming throughout this document. We will assume that
 the network card <e>eth0</e> is used.
 </p>
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2013-04-17 17:46:58 UTC
(Yes, I'm really poor at writing documentation and help is required, sorry)
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2013-05-06 13:18:24 UTC
*** Bug 451950 has been marked as a duplicate of this bug. ***
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2013-05-06 14:23:17 UTC
Okay, I modified the installation part of the handbook to tell the user that interface names can be quite different on their system, and that we assume eth0 is used for documenting purposes. There is also a part on how to deal with the installation if, after the installation, interfaces are suddenly named different (for instance when the user started installing with an installation medium that doesn't use the interface naming stuff and then boots up).

Later in the handbook, in the networking part, I added an entire section inside the "advanced" part, which explains how this works, how to disable it or how to use it to use your own interface names.

Committed to CVS, so it'll be online in an hour or so. If you can then review (especially the larger part at http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&chap=2#doc_chap4 ?)