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

Re: systemd/udev persistent network device names



On Sun, 03 May 2015 00:06:15 +0200, alexander bachmer
<alex.bachmer@t-online.de> wrote:
>von Freedesktops.org
>
> 1. You disable the assignment of fixed names, so that the unpredictable
>    kernel names are used again. For this, simply mask udev's rule file
>    for the default policy: |ln -s /dev/null
>    /etc/udev/rules.d/80-net-setup-link.rules| (since v209: this file
>    was called |80-net-name-slot.rules| in release v197 through v208)
> 2. You create your own manual naming scheme, for example by naming your
>    interfaces "internet0", "dmz0" or "lan0". For that create your own
>    udev rules file and set the NAME property for the devices. Make sure
>    to order it before the default policy file, for example by naming it
>    |/etc/udev/rules.d/70-my-net-names.rules|
> 3. You alter the default policy file, for picking a different naming
>    scheme, for example for naming all interface names after their MAC
>    address by default: |cp
>    /usr/lib/udev/rules.d/80-net-setup-link.rules
>    /etc/udev/rules.d/80-net-setup-link.rules|, then edit the file there
>    and change the lines as necessary.
> 4. You pass the net.ifnames=0 on the kernel command line (since v199)

Das beantwortet immerhin Teile meiner Frage. net.ifnames hatte ich
zwar gesehen, ging allerdings nicht davon aus, dass die
Kernelkommandozeile der einzige Punkt ist, wo man dieses Verhalten
einschalten kann.

Und dafür hättest Du auch keine 1600 Zeilen Sourcecode posten müssen,
und schon gar nicht zweimal.

Unbeantwortet bleiben meine Fragen (3) und (4) und die neue Frage,
warum meine Netzwerkinterfaces trotz net.ifnames=1 auf der
Kernelkommandozeile und nicht vorhandenem 70-persistent-net.rules
trotzdem als eth0 bis eth2 im laufenden System ankommen.

Im Netz habe ich noch gefunden:
|[3/104]mh@barrida:~$ sudo udevadm test-builtin net_setup_link /sys/class/net/eth0/
|calling: test-builtin
|load module index
|timestamp of '/etc/systemd/network' changed
|Skipping overridden file: /lib/systemd/network/99-default.link.
|Parsed configuration file /etc/systemd/network/99-default.link
|Created link configuration context.
|ID_NET_DRIVER=virtio_net
|Config file /etc/systemd/network/99-default.link applies to device eth0
|unload module index
|Unloaded link configuration context.
|[4/105]mh@barrida:~$

wobei mir hier die Zuweisung an irgend eine ID_NET_NAME variable
fehlt. 

Ist meine Frage (3) mit "über /sys/class/net/* iterieren und udevadm
test-builtin net_setup_link ausführen" beantwortet oder geht das noch
ein wenig schöner? Und wie hätte man das aus der Manpage
zusammenreimen können?

Grüße
Marc
-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber         |   " Questions are the         | Mailadresse im Header
Mannheim, Germany  |     Beginning of Wisdom "     | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834


Reply to: