Context for newbies: Linux refers to network adapters (wifi cards, ethernet cards, etc.) by so called “interfaces”. For the longest time, the interface names were assigned based on the type of device and the order in which the system discovered it. So, eth0, eth1, wlan0, and wwan0 are all possible interface names. This, however, can be an issue: “the order in which the system discovered it” is not deterministic, which means hardware can switch interface names across reboots. This can be a real issue for things like servers that rely on interface names staying the same.

The solution to this issue is to assign custom names based on MAC address. The MAC address is hardcoded into the network adaptor, and will not change. (There are other ways to do this as well, such as setting udev rules).

Redhat, however, found this solution too simple and instead devised their own scheme for assigning network interface names. It fails at solving the problem it was created to solve while making it much harder to type and remember interface names.

To disable predictable interface naming and switch back to the old scheme, add net.ifnames=0 and biosdevname=0 to your boot paramets.

The template for this meme is called “stop doing math”.

  • suction@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Small world thinking. Because you haven’t seen the need for it doesn’t mean it doesn’t exist. Also, did you lose your CTRL, C, and V keys?

    • laurelraven@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Yes, because everyone has need of this solution, and wants to have to copy and paste interface names every time they need to touch them, rather than having deterministic naming be an option to enable for those who actually need it…

        • laurelraven@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          3 months ago

          You know Linux isn’t just used by enterprise sysadmins, right?

          And even speaking as an enterprise sysadmin myself, I’ve not had need or use for deterministic interface naming once in my career. I have no clue how common that is, but most of the servers, both physical and virtual, that I’ve worked on only had one Ethernet port connected.

          I see the purpose of this, but don’t see a reason why it should be the default, or why it couldn’t have been implemented like HHD/SSD UUIDs where the old dev names were left intact for easy use outside of fstab and the like where consistency could become a problem

          ETA: you also seemed to miss the part of my initial reply to you about it being something that can be enabled by those who need it… And if you’re going to say that the enterprise professionals who need it shouldn’t have to turn it on every time they spin up a system, I’ll remind you that enterprise admins working at that level where they’re setting up enough servers for that to be a hassle are probably using orchestration like Ansible, Chef, or Puppet, and can just add that into their configs once

  • Arthur Besse@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    Redhat, however, found this solution too simple and instead devised their own scheme for assigning network interface names. It fails at solving the problem it was created to solve

    I somehow first read “Redhat” as “Reddit” in this sentence, and so was briefly thinking that perhaps this bad idea originated there 😂

  • Ananace@lemmy.ananace.dev
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    The predictable interface naming has solved a few issues at work, mainly in regards to when we have to work with expensive piece-of-shit (enterprise) systems, since they sometimes explode if your server changes interface names.
    Normally wouldn’t be an issue, but a bunch of our hardware - multiple vendors and all - initialize the onboard NIC pretty late, which causes them to switch position almost every other boot.

    I’ve personally stopped caring about interface names nowadays though, I just use automation to shove NetworkManager onto the machine and use it to get a properly managed connection instead, so it can deal with all the stupid things that the hardware does.

    • MonkderDritte@feddit.de
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      with expensive piece-of-shit (enterprise) systems, since they sometimes explode if your server changes interface names.

      Glass canons are brittle, huh?

    • corsicanguppy@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      expensive piece-of-shit (enterprise) systems, since they sometimes explode if your server changes interface names.

      At no time in the past 25 years with Medium Iron have I seen something blow up on a reboot because an interface comes up late. We’d solved the issue of unreliable init order in 1998 - RH6? Zoot? Compaq, Supermicro, even embedded stuff on was-shit/still-shit gigabyte mobos. /etc/udev/rules.d handled this eliably, consistently and perfectly. Fight me.

      • Ananace@lemmy.ananace.dev
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        You’re lucky to not have to deal with some of this hardware then, because it really feels like there are manufacturers who are determined to rediscover as many solved problems as they possibly can.

        Got to spend way too much time last year with a certain piece of HPC hardware that can sometimes finish booting, and then sit idle at the login prompt for almost half a minute before the onboard NIC finally decides to appear on the PCI bus.
        The most ‘amusing’ part is that it does have the onboard NIC functional during boot, since it’s a netbooted system. It just seems to go into some kind of hard reset when handing over to the OS.

        Of course, that’s really nothing compared to a couple of multi-socket storage servers we have, which sometime drop half the PCI bus on the floor when under certain kinds of load, requiring them to be unplugged from power entirely before the bus can be used again.

    • renzev@lemmy.worldOP
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Thanks! I love this format so much. I can’t find it now, but one of my favourite memes in this genre was something like this:

      STOP DOING

      • Tasks were never meant to be completed
      • Years of working, but there’s STILL MORE SHIT TO DO
      • Wanted to get some work done anyway, for a laugh? We had a tool for that: it was called SIMULATION GAMES
      • “Please let me sacrifice a third of my life to justify my existence. Please let me spend eight hours a day working just to be able to do it again the next day” - statements dreamt up by the utterly deranged

      Look at what people have been demanding our respect for all this time, with all the schedules and todo lists we have built for them:

      These are REAL things done by REAL people

      <Pictures of gmail, microsoft outlook, and some TODO list app>

      They have played us for absolute fools

  • orwellianlocksmith@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I have no idea at all of what this is about but I feel strongly that OP is right and we must urgently fix this disgusting problem we are facing with the interfaces. Get em, OP, get the bastards. Solidarity

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    To disable predictable interface naming and switch back to the old scheme, add net.ifnames=0 and biosdevname=0 to your boot paramets.

    What is the old scheme? This?

    The solution to this issue is to assign custom names based on MAC address. The MAC address is hardcoded into the network adaptor, and will not change. (There are other ways to do this as well, such as setting udev rules).

    Does that mean that until you name something it’s unusable?

    Anti Commercial-AI license

    • renzev@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      3 months ago

      No, the “old scheme” is the one that assigns wlan0, wlan1, eth0, eth1, and so on by default. I would say these names are pretty usable.

      The part you quoted is what you need to do if you specifically need to be sure that a specific card gets a specifc name 100% of the time. You don’t have to bother with it unless you have a reason to.

  • notabot@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    It’s amazing how many linux problems stem from ‘Redhat, however, found this solution too simple and instead devised their own scheme’. Just about every over complex, bloated bit of nonsense we have to fight with has the same genesis.

    • BCsven@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      To me it seems they followed the hdd UUID style, rather than sda0 or hda0 that can change at boot you now have a fixed UUID to work with. I can see this being important on larger server networks

      • laurelraven@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        But the SSD/HDD solution doesn’t replace /dev/[s|h]da# entirely, just adds a consistent way to set them in configs like fstab. You can still use the old device names so working with them at the command line is still easy for the most part.

          • laurelraven@lemmy.blahaj.zone
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            I mean, you should be careful with destructive changes and commands whether the interface names can change or not… And since they won’t change outside of a reboot, I’ve yet to run into a scenario where that becomes a problem as I’m looking at and making sure I’m talking to the correct device before starting anyway

    • corsicanguppy@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      It’s amazing how many linux problems stem from ‘Redhat, however, found this solution too simple and instead devised their own scheme’. Just about every over complex, bloated bit of nonsense we have to fight with has the same genesis.

      Ansible can be heard mumbling incoherently and so, so slowly, from the basement.

      Remember who saw apt4rpm and said “too fast, too immune from python fuckage, so let’s do something slower and more frail”. twice.

      • thesporkeffect@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        I won’t hear any sass about Ansible. It doesn’t scale up to infinity but it’s the best there is at what it’s good at (modular, small scale declarative orchestration)

        • Possibly linux@lemmy.zip
          link
          fedilink
          English
          arrow-up
          0
          ·
          3 months ago

          You can totally can scale Ansible and especially Ansible pull. It will work with thousands of VMs and can be used with other tools to completely automate deployments.

      • notabot@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        I do use Ansible, partly because it’s easier to tell people that’s how you do it rather than “I wrote a shell script, it took half the time to write, it’s 20% the size and runs several times faster”. To be fair to Ansible, if you’re configuring a number of servers at the same time, it’s not too bad speedwise as it’ll do batches of them in parallel. Configuring one server at a time is agony though.

      • notabot@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        He’s definitely off my Christmas card list. He seems desperate to leave a legacy, but he keeps trying to turn Linux into windows instead.

          • notabot@lemm.ee
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            He may have taken some ideas from there, but I still see more windows like ideas. We’re one bad decision away from systemd-regedit. If that happens, I might just give up completely.

              • renzev@lemmy.worldOP
                link
                fedilink
                English
                arrow-up
                0
                ·
                edit-2
                3 months ago

                “everything is a file” is such a godsend. It makes absolutely everything so much easier and intuitive. I remember trying to get an old dot matrix printer to work using a parallel-to-usb adaptor cable. Without reading any documentation or having any prior experience I tried echo testing12345 > /dev/lp0 and it just worked lol. Meanwhile my friend spent like half an hour digging in windows gui settings trying to figure out how to print to a parallel printer.

                I also posted about this before, but a while back I had to configure my system so that a non-root user could start and stop a root daemon without sudo. On a runit system all you have to do is change the permissions of some control files and it works. On systemd? When I looked it up, the simplest solution involved writing a polkit policy in javascript 🤮

              • notabot@lemm.ee
                link
                fedilink
                arrow-up
                0
                ·
                3 months ago

                cries It’s amazing how much damage they’ve done to the linux ecosystem. Not just badly thought out concepts, but the amount of frustration and annoyance they caused by ramming it into existence and the cynicism it’s created.

            • renzev@lemmy.worldOP
              link
              fedilink
              English
              arrow-up
              0
              ·
              3 months ago

              systemd-regedit

              That’s just dconf lol. It sounds great in theory – after all, isn’t bringing standardization to a chaotic battlefield of different formats a good thing? But in practice it’s absolute garbage. I would much rather just edit a config file. Heck, even if you program uses some obscure config format like xml or something language-specific like .lua or .py, I would much rather take a few minutes to learn the specifics of your format than fuck around with dconf. Fuck dconf.

              • notabot@lemm.ee
                link
                fedilink
                arrow-up
                0
                ·
                3 months ago

                Yes, yes, but now lets take that, make it dependent on the session management system and dns resolver for some reason, make the command longer and more convoluted and store the results in one or more of a dozen locations! It’ll be great!

                /s

                Dconf is bad, just imagine how bad a systemd version would be.

    • jonne@infosec.pub
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Also, canonical decided to try and solve the same ‘problem’ in a different, equally convoluted way.

      • notabot@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        I try not to think about the things they’ve done, it’s not good for my blood pressure. They had a decent desktop distro, but they seem determined to trash it with terrible decisions.

    • renzev@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      What I really don’t understand is why distro maintainers feel the need to actually go along with these changes. Like, sure, if this predictable interface naming thing worked as intended, I can definitely see how it can be useful for server administrators. You could just hardcode the automatic interface names instead of assigning them manually in /etc/mactab. But why would the rest of us ever need this? Most personal machines have at most one wifi card and one ethernet device, so wlan0 and eth0 are perfectly predictable. And even if you have multiple wifi or ethernet adapters, your networking is probably handled by network-manager, so you never actually have to put interface names into config files. Why force enterprise-grade bloat on users who just want a simple desktop experience?

      • ikidd@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        As to why distro maintainers go along, if you had to vet every time the network stack updated and make sure it doesn’t break your custom solution to predictable naming, you’d probably just go along with it and let anyone that needed it devise and maintain their own solution. 99% of users won’t worry about it.

        • notabot@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          No need for a custom solution, we already had ways to make predictable names that worked better than this. Giving each interface a name that represents it’s job makes life so much easier when you have several, naming them after which PCI bus they’re on does not.

      • notabot@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        Personally I’d do away with NetworkManager too and just configure the interfaces directly, but that might just be me being old and grumpy!

        I think most distros go along because their upstream did. There are comparatively few ‘top level’ distributions, the main ones (by usage) being Redhat and Debian. Most everything else branches from those. Redhat’s got enough clout on the market that there’s a sort of pull towards complying with it just to not be left put.

        I use Debian, but I think they’re crazy for swallowing everything Redhat pushes, they could easily stick to the cleaner options and have a better system for it. At least they let you opt out of systemd, so life is a little more tolerable.

        • renzev@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          3 months ago

          I’d do away with network-manager on a stationary system too, but I’m on a laptop, and unless there’s some trick I don’t know about, configuring wifi by hand for every new network I come across sounds like a bit of a pain. Especially for corporate/institution network that use fancy things like PEAP

          • notabot@lemm.ee
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            That’s fair, it does make sense to use it on a laptop, but it really should be the sort of thing you add when needed rather than having it jammed in whether it’s useful or not.

            Every time I need to do something even slightly different to a basic setup I find myself inventing new curses for those who screwed things up with these overblown, over complex, minimally functional abominations. Just give me vi and the basic configuration files and let me get on with it!

            • renzev@lemmy.worldOP
              link
              fedilink
              English
              arrow-up
              0
              ·
              3 months ago

              I find myself inventing new curses for those who screwed things up with these overblown, over complex, minimally functional abominations

              Gosh, tell me about it. I once tried writing a custom wifi signal strength indicator app that got its information from network-manager. Apparently the only way to programmatically communicate with network-manager is through dbus, which is just terrible. Scarce to no documentation, poor support for any language other than C/C++, and once you do get it working, it’s the most disgusting and overly verbose code you’ve ever seen, just to query the status of the wifi card. Could’ve exposed the API through raw unix sockets or something, but nope, they had to reinvent the wheel on that one as well.

              Just give me vi and the basic configuration files and let me get on with it!

              I’ll take this opportunity to shill for Void Linux, it sounds like exactly what you’re describing. I’ve been a happy user for like 5 years now. I particularly like how nothing ever breaks, because there’s not much to break on such a minimal system.

              …well, actually, a few things did break over the years, but most of those were due to user error haha.

              • notabot@lemm.ee
                link
                fedilink
                arrow-up
                0
                ·
                3 months ago

                In news that will shock no-one, dbus was, of course, initially created by a Redhat engineer. I get the idea of having a general purpose bus that everything can communicate on, but they somehow managed to even make that complex.

                You make a compelling case for Void Linux. I use Debian or a RHEL derivative for work, primarily so there’s at least a chance to hand systems off to someone else to maintain, the less known distros seem to meet with blank looks.

                I want to give NixOS a try sometime, as I like the idea of declaritively defining the system

                • llii@discuss.tchncs.de
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  edit-2
                  3 months ago

                  I want to give NixOS a try sometime, as I like the idea of declaritively defining the system

                  That seems to be even more convoluted and complex.

                  “Just one more abstraction layer, I swear!”

                  I’m a NixOS noob bytheway, so please correct me if I’m wrong.

          • crater2150@feddit.de
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            If by “configuring wifi by hand” you mean writing config files by hand, that’s actually not necessary with plain wpa_supplicant too. There is wpa-gui (or wpa-cute if you prefer Qt over GTK), which is basically a GUI frontend to wpa_supplicant, which makes adding new networks nearly as easy as with NetworkManager. But it’s a far less modern looking UI than the NM frontends.

        • MonkderDritte@feddit.de
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          3 months ago

          Personally I’d do away with NetworkManager too and just configure the interfaces directly

          Connman and iwd have nice graphical interfaces btw. I got that route after nm disbehaved and i couldn’t figure out why (same for systemd and s6/dinit after systemd-dnsd threw a fit).

          • anyhow2503@lemmy.world
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            I tried using connman to setup a wireguard connection once. It was not a good experience and ultimately led nowhere, due to missing feature support.

    • MalReynolds@slrpnk.net
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      You’re not wrong. But generally the idiocy is in response to beserkeness elsewhere, madness follows…

        • corsicanguppy@lemmy.ca
          link
          fedilink
          English
          arrow-up
          0
          ·
          3 months ago

          so does RPM.

          Careful. Jeff’s format gives us really great advantages from an atomic package that we don’t have elsewhere. THAT, at least, was a great thing.

          Lennart’s Cancer, though, can die in a fire.

          • 01101000_01101001@mander.xyz
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            Atomic updates are amazing. But the package manager is slow as hell. SuSE managed to make zypper much faster using the same package format.

            • anyhow2503@lemmy.world
              link
              fedilink
              arrow-up
              0
              ·
              3 months ago

              The only thing that’s slow is dnf’s repository check and some migration scripts in certain fedora packages. If that’s the price I need to pay to get seamless updates and upgrades across major versions for nearly a decade, then I can live with that.

      • notabot@lemm.ee
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        I’m with our binary friend; the systems they try to replace tend to be time tested, reliable and simple (if not necessarily immediately obvious) to manage. I can think of a single instance where a Redhat-ism is better, or even equivalent, to what we already have. In eavh case it’s been a pretty transparent attempt to move from Embrace to Extend, and that never ends well for the users.

        • renzev@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          0
          ·
          3 months ago

          I can think of a single instance where a Redhat-ism is better

          I don’t know if it would be accurate to call it a redhat-ism, but btrfs is pretty amazing. Transparent compression? Copy-on-write? Yes please! I’ve been using it for so long now that it’s spoiled me lol. Whenever I’m on an ext4 system I have to keep reminding myself that copying a huge file or directory will… you know… actually copy it instead of just making reflinks

          • notabot@lemm.ee
            link
            fedilink
            arrow-up
            0
            ·
            3 months ago

            I’ve never actually tried BTRFS, there were a few too many “it loses all your data” bugs in the early days, and I was already using ZFS by then anyway. ZFS has more than it’s fair share of problems, but I’m pretty confident my data is safe, and it has the same upsides as BTRFS. I’m looking forward to seeing how BCachefs works now it’s in kernel, and I really want to compare all three under real workloads.

            • farcaller@fstab.sh
              link
              fedilink
              arrow-up
              0
              ·
              3 months ago

              There’s a whole bunch of “it loses all your data” bugs in OpenZFS too, ironically, although it’s way way less fragile than btrfs in general.

              That said, the latter is pretty much solid too, unless you do raid5-like things.

            • renzev@lemmy.worldOP
              link
              fedilink
              English
              arrow-up
              0
              ·
              3 months ago

              Ooh, I’ve never heard of bcachefs, sounds exciting! I see it supports encryption natively, which btrfs doesn’t. Pretty cool!

              Personally I’ve never had any issues with btrfs, but I did start using it only a couple years ago, when it was already stable. Makes sense that you’d stick with zfs tho, if that’s what you’re used to.

  • Mora@pawb.social
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Thanks for this post. I’ve been working with Interfaces on Red Hat nodes this week and I’ve already wondered what the hell is going on there.

  • Badabinski@kbin.earth
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I always just derive the interface name from first principles. Like, if I want to know which interface will be used to get out to the internet in a script, I’ll just find the one that’s L2 adjacent with the default gateway. If I’m given an egress or cidr, I’ll just find the interface that has that IP. Modern iproute2 has a JSON output option which makes getting this information pretty trivial. Doing that means that it doesn’t matter what scheme your OS is using.

    I personally prefer the persistent names for Ethernet, although I don’t like them for WiFi. Luckily, it seems like my wireless adapter always just ends up as wlan0. I’m not sure why that’s the case, but it works out well in the end for me.

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    me setting my interface into monitor mode manually because it can’t handle being split into mon and managed.