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

Re: Predictable Network Interface Names



On 3/30/22, Dan Ritter <dsr@randomstring.org> wrote:
> Greg Wooledge wrote:
>> On Wed, Mar 30, 2022 at 07:18:07PM +0100, Brian wrote:
>> > That's good advice, but are MAC addresses memorable?
>>
>> Doesn't matter.  You can choose a memorable name.  The MAC address is
>> simply the data point you place in the config file, so the system knows
>> this is the interface you're talking about.
>>
>> unicorn:~$ cat /etc/systemd/network/10-lan0.link
>> [Match]
>> MACAddress=18:60:24:77:5c:ec
>>
>> [Link]
>> Name=lan0
>>
>> That's what I'm using.  Of course, this relies on the MAC address being
>> consistent across boots.  I've heard of some cases where this isn't
>> true, but I believe those cases involved removable devices (USB network
>> interfaces or similar).
>
> Some NICs can have their MAC addresses changed permanently.
>
> There were at least a few terrible NICs in history where an
> entire production run got the same MAC address assigned.
>
> Most NICs can have their MAC addresses reassigned after boot,
> which will almost always be reset on next power cycle.
>
> lan0 is a good name. I like names like "internal" and "dmz" and  "internet"
> or "cogent" and "level3" -- either functional descriptors or
> where their other ends are connected.


macchanger.. I tried it a couple years ago for some forgotten reason.
I think it was when the names first started changing on us, and I was
trying to take control of the situation. I remember it working and
then not working. Can't remember now why I gave up on it. Thankfully
things have ironed out some since so it hasn't been needed in my usage
case.

>From "apt-cache show," it seems to reference the same vendor MAC
duplication instances (Point #4):

Features:
 .
   * set specific MAC address of a network interface
   * set the MAC randomly
   * set a MAC of another vendor
   * set another MAC of the same vendor
   * set a MAC of the same kind (eg: wireless card)
   * display a vendor MAC list (today, 6200 items) to choose from

Afterthought, my problems eased up after I figured out I could grep
dmesg for "renamed from" and plug that result into where I needed the
name. Tripped over that by accident. Might have started out grepping
for eth0, maybe.

Have fun!

Cindy :)
-- 
Talking Rock, Pickens County, Georgia, USA
* runs with birdseed *


Reply to: