[DNG] if2mac init.d service for persistent network interface names

2020-12-17 Thread tito via Dng
Hi,
a few days ago I was able to complete may new router
with 12 nics and 1 wifi. I moved the devuan drive from
my previous defunct box to the new one and experienced
all the problems reported in the "Ethernet names revisited"
thread.
I tried all the wise advice of the thread included my own
just to discover that nothing really works reliably.

Things I've tried in various combinations:

1) 70-persistent-net.rules with mac
2) 70-persistent-net.rules with pci bus numbers
3) 60-persistent-net.rules with mac
4) 60-persistent-net.rules with pci bus numbers
5) net.ifnames=0 / net.ifnames=1 in grub
6) biosdevname=0 in grub
7) renaming the interfaces in /etc/network/interfaces
8) using ifrename

Always the 12 nics came up with different names,
or some of them were missing due to collisions
during the rename process and the router was 
borked with me yelling.
Especially sarcastic I've found the definition of
the new "predictable names" because there is
nothing really predictable about them and at every
reboot they can be totally different, one time being
enp5s0 and next time enp8s0f1 depending on
the BIOS initialization process ( I suppose).
At the end I started thinking about a KISS way to get
my persistent interface names back without
using udev/eudev or other non cooperative software. 
I've come up with a init script that I've called
if2mac that matches interfaces to mac addresses
early in the boot process before networking is set up,
that for me works reliably (after a night of reboots).
I post it here so that If some bold beta testers on the list
are interested they can try it out in the hope that
it works for them (and AT THEIR OWN RISK!!!).
To use it copy the script to /etc/init.d/:

cp if2mac /etc/init.d/
chmod +x /etc/init.d/if2mac
insserv if2mac

and the configuration file to /etc/if2mac.conf.

## Sample configuration file for if2mac.
##
## WIRED_MAC_LIST and WIRELESS_MAC_LIST contain a list of MAC
## addresses in the desired order top to down starting at
## position 0. For example:
## WIRED_MAC_LIST="\
## 00:11:22:33:44:54 \ <= The space is needed!!!
## 00:11:22:33:44:55 \
## 00:11:22:33:44:56"
## The WIRED_PREFIX and WIRELESS_PREFIX variables can be changed
## at your liking (opt, port, whatever).

WIRED_PREFIX="eth"

WIRED_MAC_LIST="\
00:12:21:c4:56:68 \
00:12:21:c4:56:69 \
00:13:21:c4:56:6a \
00:13:21:c4:56:6b \
00:33:18:04:a3:46 \
00:34:18:04:a3:47 \
00:35:18:04:a3:48 \
00:36:18:04:a3:49 \
00:36:18:04:a3:4a \
00:36:18:04:a3:4b \
00:36:18:04:a3:4c \
00:56:18:04:a3:4d"

WIRELESS_PREFIX="wlan"

WIRELESS_MAC_LIST="\
54:2a:a2:2b:b3:55"

Attached you will find the init script and a sample
configuration file. Multiple configuration files
to allow more prefixes are not supported because
this kind of renaming could be done in /etc/network/interfaces
once the interfaces came up with predictable and persistent names. 
At this time only 

en  Ethernet wired
et Ethernet wired old
wl Wireless local area network (WLAN)

interfaces are supported with both old style
and new "predictable" names.

Prerequisites are:
/bin/cat
/sbin/ip
and a mounted /sysfs.

Hints improvements and critics are welcome.
Eventually if there is some interest this could be packaged 
(with the help of some devuan packaging gurus).

Hope this helps. Enjoy.
Ciao,
farmatito


if2mac
Description: Binary data


if2mac.conf
Description: Binary data
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ethernet names revisited

2020-12-17 Thread Antony Stone
On Thursday 17 December 2020 at 13:03:57, rattenkopf via Dng wrote:

> hi Antony
> 
> Yesterday I had the same problem - mainboard network interface gets eth1
> as name and the both interfaces from the pci-card are eth0 and eth2 and
> fiddling with udef-rule didn't get the wanted result.

Indeed - I'm now using my workaround of telling udev rules to assign names 
xeth0, xeth1 etc, and then in /etc/network/interfaces renaming those to eth0, 
eth1, etc.

> But I notice, that as system booted from an usb stick dos not have this
> problem, but the stick could only booted, if uefi was enabled.

Hm, interesting.

> So I decided to install grub with efi extension and after that, the
> system comes up with eth0 from the mainboard and eth1 and eth2 where
> given to the pci-card interfaces.
> 
> But I don't know, if this always happens with uefi or only with that of
> this board (dell PowerEdge)

Well, in my case I can't test that because my machines don't do UEFI (HP N54L 
microservers, Bios only).

Do you have any setting for net.ifnames in your Grub kernel boot parameters?


Antony.

-- 
It may not seem obvious, but (6 x 5 + 5) x 5 - 55 equals 5!

   Please reply to the list;
 please *don't* CC me.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ethernet names revisited

2020-12-17 Thread rattenkopf via Dng
hi Antony

Yesterday I had the same problem - mainboard network interface gets eth1
as name and the both interfaces from the pci-card are eth0 and eth2 and
fiddling with udef-rule didn't get the wanted result.

But I notice, that as system booted from an usb stick dos not have this
problem, but the stick could only booted, if uefi was enabled.

So I decided to install grub with efi extension and after that, the
system comes up with eth0 from the mainboard and eth1 and eth2 where
given to the pci-card interfaces.

But I don't know, if this always happens with uefi or only with that of
this board (dell PowerEdge)

Fine regards
rolf
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] snapd in Devuan? Dependency on systemd...

2020-12-17 Thread Simon Walter

On 12/2/20 4:44 PM, Ian Zimmerman wrote:

On 2020-12-02 01:09, Bernard Rosset via Dng wrote:


Certbot has removed support of certbot-auto for Debian-based systems


Sorry, I feel contrarian today (and many other days too). So there:

http://michael.orlitzky.com/articles/lets_not_encrypt.xhtml



Nice read. Thanks!
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng