<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 16/08/21 5:39 pm, Lennart Poettering
wrote:<br>
</div>
<blockquote type="cite" cite="mid:YRpVaAkoG3MtRvzq@gardel-login">
<pre class="moz-quote-pre" wrap="">On Mo, 16.08.21 17:31, Amish (<a class="moz-txt-link-abbreviated" href="mailto:anon.amish@gmail.com">anon.amish@gmail.com</a>) wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
On 16/08/21 5:25 pm, Lennart Poettering wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">On Mo, 16.08.21 16:09, Amish (<a class="moz-txt-link-abbreviated" href="mailto:anon.amish@gmail.com">anon.amish@gmail.com</a>) wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Some old scripts that we have expect interface names starting with eth. But
those names are not predictable.
So to get predictable names starting with eth*, first I temporarily rename
all interface with tmpeth*. This is done via udev rules.
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="XX:XX:XX:XX:XX:XX",
NAME="tmpeth0"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="XX:XX:XX:XX:XX:YY",
NAME="tmpeth1"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="XX:XX:XX:XX:XX:ZZ",
NAME="tmpeth2"
Then I have a small service (script) which runs before network-pre.target to
convert these names back to eth*
#search for network interface with name starting from "tmpeth" and rename
them to "eth"
/usr/bin/find /sys/class/net -maxdepth 1 -name "tmpeth[0-9]" -type l -printf
"%f\n" | while read tmpiface; do /usr/bin/ip link set dev "$tmpiface" name
"$(echo $tmpiface | sed s/tmpeth/eth/)"; done
This ensures that I have predictable names starting with eth*. And it is
working fine from 2-3 years. Even with current issue, name assignment is
working fine.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">This cannot work and is necesarily race. Stay out of the ethXYZ
namespace, that's the kernel's namespace. Pick any other names,
i.e. "foobar0", "foobar1", but otherwise you just have a racy racy
mess, because the kernel might take the name whenever it pleases.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
No I dont think this is race. Because my script runs after Udev has finished
assigning the interfaces names.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
device probing can take any time it wants. there isn't a point in time
where everything is probed.</pre>
</blockquote>
<p>These are internal PCI LAN cards. I believe these gets probed
(and named) sufficiently early.</p>
<p>And then we can expect names assigned by Udev to remain same.</p>
<p>And I can see in the logs that names are not changed after my
script runs.</p>
<p>Also this has been working successfully for me from 2 or more
years.</p>
<p>But after today's update, something is breaking all the systems.</p>
<p>Additionally just now on other system I see eth2 (instead of
eth1) being renamed to eth0.</p>
<p>I just want to know what changed and where? (Kernel or Systemd?).</p>
<p><b>Also another point is, I have set ConfigureWithoutCarrier=yes
in network files and all are static IPs, so systemd-networkd
should have configured the devices even if links are not up. But
its not doing that anymore either after today's update.</b><br>
</p>
<p>Regards</p>
<p>Amish.<br>
</p>
<blockquote type="cite" cite="mid:YRpVaAkoG3MtRvzq@gardel-login">
<pre class="moz-quote-pre" wrap="">Lennart
--
Lennart Poettering, Berlin
</pre>
</blockquote>
</body>
</html>