<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=2216&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Deterministic names for network interfaces?]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=2216</link>
		<description><![CDATA[The most recent posts in Deterministic names for network interfaces?.]]></description>
		<lastBuildDate>Sat, 14 Jul 2018 19:06:18 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10725#p10725</link>
			<description><![CDATA[<p>@FM81: I mean is there a statement in the rules file that causes the section you&#039;re interested in to be skipped, like this</p><div class="codebox"><pre><code>[19] bryan: cat /etc/udev/rules.d/28-pemicro.rules
ACTION!=&quot;add&quot;, SUBSYSTEM!=&quot;usb&quot;, GOTO=&quot;kcontrol_rules_end&quot;

ATTR{idVendor}==&quot;15a2&quot;, ATTR{idProduct}==&quot;0035&quot;, MODE:=&quot;0666&quot;
ATTR{idVendor}==&quot;15a2&quot;, ATTR{idProduct}==&quot;0042&quot;, MODE:=&quot;0666&quot;
ATTR{idVendor}==&quot;15a2&quot;, ATTR{idProduct}==&quot;0058&quot;, MODE:=&quot;0666&quot;
ATTR{idVendor}==&quot;15a2&quot;, ATTR{idProduct}==&quot;005e&quot;, MODE:=&quot;0666&quot;
ATTR{idVendor}==&quot;15a2&quot;, ATTR{idProduct}==&quot;005f&quot;, MODE:=&quot;0666&quot;
ATTR{idVendor}==&quot;1357&quot;, MODE:=&quot;0666&quot;

LABEL=&quot;kcontrol_rules_end&quot;
[20] bryan:</code></pre></div><p>(Don&#039;t know what pemicro is. It&#039;s just an example.) BTW, this &quot;enp...&quot; stuff is all news to me. Wasn&#039;t aware that &quot;eth...&quot; was old-style.</p><p>As another SWAG, you might try changing the KERNEL match part of your rules file lines to read &#039;KERNEL==&quot;*&quot;&#039;</p><p>Good luck,</p>]]></description>
			<author><![CDATA[dummy@example.com (bbatten)]]></author>
			<pubDate>Sat, 14 Jul 2018 19:06:18 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10725#p10725</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10686#p10686</link>
			<description><![CDATA[<p>I don&#039;t know exactly which set up you had before or which you have now, but I do know that it works how I described.</p><p>For this, I installed a fresh Devuan ascii VM with two network interfaces, and have explored the variations. It appears to be the case, that the kernel establishes its interface naming before the <span class="bbc">udev</span> (i.e., <span class="bbc">eudev</span>) processing gets a chance. Therefore the first attempt to rename <span class="bbc">eth0</span> to <span class="bbc">eth1</span> fails, etc.</p><p>In my VM, I only added <span class="bbc">/etc/udev/rules.d/70-persistent-net.rules</span> with the two rules (adapted for my mac addresses of course), and looked at the effects of the various alternatives. The set up of naming the secondary interface <span class="bbc">eth2</span> works fine.</p><p>This test system will of course always pass the kernel&#039;s <span class="bbc">eth0</span> first to <span class="bbc">udev</span>. With physical adapters I can imagine the possibility that the kernel passes its <span class="bbc">eth1</span> first, in which case this solution would fail anyhow, and then you would rather need to rename both interfaces to unused names.</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Mon, 09 Jul 2018 21:05:11 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10686#p10686</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10684#p10684</link>
			<description><![CDATA[<p>@fsmithred: If I try you last variant it starts without any error. But my interfaces are still named &#039;enp3s0&#039; and &#039;enp2s0&#039; ??? (No, there is nothing UPPERCASED on any place.)<br />May be, we should stop searching here, there seems no easy solution? Effort and benefits didn&#039;t stand in a acceptable relation for this small problem!</p><p>@bbatten: I didn&#039;t understand you answer, may be because english isn&#039;t my native language; but in none of the files is the keyword GOTO used?</p><p>Best Regards, FM_81</p>]]></description>
			<author><![CDATA[dummy@example.com (FM81)]]></author>
			<pubDate>Mon, 09 Jul 2018 19:15:31 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10684#p10684</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10682#p10682</link>
			<description><![CDATA[<p>The example script doesn&#039;t work because it does not get the mac address correctly. The output of ifconfig changed from jessie to stretch/ascii and no longer shows HWaddr.</p><p>Edit get-mac-address.sh and change</p><div class="codebox"><pre><code>mac=$(/sbin/ifconfig &quot;$iface&quot; | sed -n -e &#039;/^.*HWaddr \([:[:xdigit:]\-]*\).*/{s//\1/;y/ABCDEF/abcdef/;p;q;}&#039;)</code></pre></div><p>to </p><div class="codebox"><pre><code>mac=$(/bin/ip link | grep -A1 &quot;$iface&quot; | awk &#039;/link/ { print $2 }&#039;)</code></pre></div><p>Note: If your mac addresses have any upper case letters, the above line will need more than I can give you right now.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Mon, 09 Jul 2018 18:20:33 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10682#p10682</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10680#p10680</link>
			<description><![CDATA[<p>@FM81 - Just a SWAG, but are there any lines with a GOTO preceding the lines in question? (Almost embarrassed to ask.)</p>]]></description>
			<author><![CDATA[dummy@example.com (bbatten)]]></author>
			<pubDate>Mon, 09 Jul 2018 16:59:47 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10680#p10680</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10676#p10676</link>
			<description><![CDATA[<p>@fsmithred: I&#039;ve tried your suggesstion, of course I also made it executable on the new place. It gives during init two messages:</p><div class="codebox"><pre><code>ifup: error trying to execute mapping script /etc/network/interfaces.d/get-mac-address.sh on enp3s0
ifup: error trying to execute mapping script /etc/network/interfaces.d/get-mac-address.sh on enp2s0</code></pre></div><p>and ends with two unconfigured interfaes, still with their old names (enp*). If I execute the script manually (with one or two or three parameters) it simply hangs, there is no returning to the prompt?</p><p>@UnclePa: I didn&#039;t know about this fact. But all my experiments was done with lowercase (without knowing it before)!</p><p>@ralph.ronnquist: I had such an rule on Debian 6 and Debian 7 and Devuan 1.0.0. It was always seen and accepted. So I&#039;m lost at this point and didn&#039;t understand, why well working things suddenly didn&#039;t work anymore?</p><p>Greetings, FM_81</p>]]></description>
			<author><![CDATA[dummy@example.com (FM81)]]></author>
			<pubDate>Mon, 09 Jul 2018 14:56:32 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10676#p10676</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10671#p10671</link>
			<description><![CDATA[<p>As far as I can tell, the first rule pair is the right one. However,&#160; it&#039;s not possible to rename an interface to an already taken name, and the problem is that the <span class="bbc">udev</span> rules apply well after both interfaces have gained their kernel names. I.e., both names <span class="bbc">eth0</span> and <span class="bbc">eth1</span> are in use when the rules apply.</p><p>Thus, when <span class="bbc">udev</span> wants to rename <span class="bbc">eth0</span> to <span class="bbc">eth1</span>, it fails because <span class="bbc">eth1</span> is already taken. Then the renaming of <span class="bbc">eth1</span> to be <span class="bbc">eth0</span> also fails for the same reason.</p><p>You may however probably rely on that the interface originally named <span class="bbc">eth0</span> by the kernel will be processed first. You could therefore set up the rules to name the secondary interface <span class="bbc">eth2</span> rather than <span class="bbc">eth1</span>. Doing so makes <span class="bbc">eth0</span> free for any subsequent renaming of the other interface. In that case you will have the interfaces named as <span class="bbc">eth0</span> and <span class="bbc">eth2</span> via their mac addresses.</p><p>If you insist on having <span class="bbc">eth0</span> and <span class="bbc">eth1</span> you will need a subsequent renaming to happen. That is not easily done through <span class="bbc">udev</span>, but I think&#160; the <span class="bbc">ifrename</span> package would be able to deal with this.</p>]]></description>
			<author><![CDATA[dummy@example.com (ralph.ronnquist)]]></author>
			<pubDate>Mon, 09 Jul 2018 12:41:27 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10671#p10671</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10670#p10670</link>
			<description><![CDATA[<p>One thing you might check, according to Arch&#039;s wiki, udev doesn&#039;t like upper case letters in the MAC addresses.&#160; I have 2 network cards but haven&#039;t had that problem, either because they both use the same driver or I haven&#039;t rebooted enough times for it to happen.</p>]]></description>
			<author><![CDATA[dummy@example.com (UnclePa)]]></author>
			<pubDate>Mon, 09 Jul 2018 12:35:58 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10670#p10670</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10669#p10669</link>
			<description><![CDATA[<p>I think this is right, but I haven&#039;t tested it. See &#039;man interfaces&#039; and also look at the files in /usr/share/doc/ifupdown/examples. </p><p>Copy the get-mac-address.sh script from the examples directory into /etc/network/interfaces.d/ and make it executable. Then edit the interfaces file like this:</p><div class="codebox"><pre><code>auto enp3s0 enp2s0
mapping enp3s0 enp2s0
  script /etc/network/interfaces.d/get-mac-address.sh
  map 00:55:44:33:22:11 eth0
  map 00:11:22:33:44:55 eth1
iface eth0 inet dhcp
iface eth1 inet static
	address 192.168.1.17
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Mon, 09 Jul 2018 12:30:53 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10669#p10669</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10666#p10666</link>
			<description><![CDATA[<p>Good morning!</p><p>As UDEV-rule I&#039;ve tried this:</p><div class="codebox"><pre><code>SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:11:22:33:44:55&quot;, KERNEL==&quot;eth*&quot;, NAME==&quot;eth0&quot;
SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:55:44:33:22:11&quot;, KERNEL==&quot;eth*&quot;, NAME==&quot;eth1&quot;</code></pre></div><p>and this:</p><div class="codebox"><pre><code>SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:11:22:33:44:55&quot;, KERNEL==&quot;enp*&quot;, NAME==&quot;eth0&quot;
SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:55:44:33:22:11&quot;, KERNEL==&quot;enp*&quot;, NAME==&quot;eth1&quot;</code></pre></div><p>and this:</p><div class="codebox"><pre><code>SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:11:22:33:44:55&quot;, KERNELS==&quot;pci000:00&quot;, NAME==&quot;eth0&quot;
SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:55:44:33:22:11&quot;, KERNELS==&quot;pci000:00&quot;, NAME==&quot;eth1&quot;</code></pre></div><p>and also this:</p><div class="codebox"><pre><code>SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:11:22:33:44:55&quot;, KERNELS==&quot;0000:03:00.0&quot;, NAME==&quot;eth0&quot;
SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:55:44:33:22:11&quot;, KERNELS==&quot;0000:02:00.0&quot;, NAME==&quot;eth1&quot;</code></pre></div><p>But none of them had any effect?</p><p>The mapping approach sounds good, but I have no expierience of this?<br />I&#039;ve found many arcticles in the web, but all of them describe much more complex scenarios than a simple renaming!?<br />My INTERFACES-file looks as follow:</p><div class="codebox"><pre><code># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface, called &quot;eth0&quot; in the good old days!
auto enp3s0
iface enp3s0 inet dhcp

# The secondary network interface, called &quot;eth1&quot; in the good old days!
allow-hotplug enp2s0
iface enp2s0 inet static
	address 192.168.1.17
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255</code></pre></div><p>Which changes has to be done, to get &#039;enp3s0&#039; as &#039;eth0&#039; and &#039;enp2s0&#039; as &#039;eth1&#039;?</p><p>Thank you and best regards, FM_81</p>]]></description>
			<author><![CDATA[dummy@example.com (FM81)]]></author>
			<pubDate>Mon, 09 Jul 2018 08:43:39 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10666#p10666</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10639#p10639</link>
			<description><![CDATA[<p>I think that&#039;s still the right place to put your own rules, but I don&#039;t really know much about udev rules or what goes into them. Did you try using KERNEL==&quot;enp*&quot; instead of KERNEL==&quot;eth*&quot;? (just a guess)</p><p>Another possibility is to rename the interfaces in /etc/network/interfaces. See the section on MAPPING in man interfaces. You should be able to give them any names you want.</p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Fri, 06 Jul 2018 14:08:57 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10639#p10639</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10619#p10619</link>
			<description><![CDATA[<p>Good morning!</p><p>I put it in </p><div class="codebox"><pre><code>/etc/udev/rules.d/</code></pre></div><p>Is this still guilty or do I have something missed in between?</p><p>Best Regards, FM_81</p>]]></description>
			<author><![CDATA[dummy@example.com (FM81)]]></author>
			<pubDate>Thu, 05 Jul 2018 04:00:22 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10619#p10619</guid>
		</item>
		<item>
			<title><![CDATA[Re: Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10605#p10605</link>
			<description><![CDATA[<p>Where did you put the rule?</p><p>I haven&#039;t tried ascii with two nics. Here&#039;s a discussion on the dng mailing list that might be helpful:<br /><a href="https://lists.dyne.org/lurker/message/20180630.210609.86421f1c.en.html" rel="nofollow">https://lists.dyne.org/lurker/message/2 … 1c.en.html</a></p>]]></description>
			<author><![CDATA[dummy@example.com (fsmithred)]]></author>
			<pubDate>Wed, 04 Jul 2018 11:18:07 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10605#p10605</guid>
		</item>
		<item>
			<title><![CDATA[Deterministic names for network interfaces?]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=10602#p10602</link>
			<description><![CDATA[<p>Hello!</p><p>System is Devuan 2.0.0, standard installation with Network-Installer. I have an AMD64-machine, two network interfaces:<br />A gigabit onboard, lets call it <strong>A</strong> with DHCP and a 100M on a PCI-slot lets call it <strong>B</strong> with a static given address in a separate range of course.<br />If I add <strong>net.ifnames=1</strong> to the grub-commandline nearly everything is fine. <strong>A</strong> is always &#039;enp3s0&#039; and <strong>B</strong> is always &#039;enp2s0&#039;.</p><p>How ever, I would prefer to have old style &#039;eth0&#039; and &#039;eth1&#039;; I get this if I remove the additional boot-parameter of course!<br />But in this case it isn&#039;t defined which is which, sometimes <strong>A</strong> = &#039;eth0&#039; and <strong>B</strong> = &#039;eth1&#039; an on next boot it may reversed as <strong>B</strong> = &#039;eth0&#039; and <strong>A</strong> = &#039;eth1&#039; (or on second or third restart only, you cannot say it, before you test it.).<br />Now one may think: &#039;Create an UDEV-rule and everything is nice.&#039; I&#039;ve created one, but it seems to be ignored completly:</p><div class="codebox"><pre><code>SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:55:44:33:22:11&quot;, ATTR{dev_id}==&quot;0x0&quot;, ATTR{type}==&quot;1&quot;, KERNEL==&quot;eth*&quot;, NAME=&quot;eth0&quot;
SUBSYSTEM==&quot;net&quot;, ACTION==&quot;add&quot;, DRIVERS==&quot;?*&quot;, ATTR{address}==&quot;00:11:22:33:44:55&quot;, ATTR{dev_id}==&quot;0x0&quot;, ATTR{type}==&quot;1&quot;, KERNEL==&quot;eth*&quot;, NAME=&quot;eth1&quot;</code></pre></div><p>(I&#039;ve also tried several variants of this.)<br />Is there a chance, to get the normal network-interface-names back in a stable manner?</p><p>Thank you and have a nice day ...<br />FM_81</p>]]></description>
			<author><![CDATA[dummy@example.com (FM81)]]></author>
			<pubDate>Wed, 04 Jul 2018 09:38:32 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=10602#p10602</guid>
		</item>
	</channel>
</rss>
