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”.

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

      Thanks, glad you like it! I spent quite some time re-making the template from scratch in inkscape, because the original meme din’t have enough space for the text

  • orwellianlocksmith@lemmy.world
    link
    fedilink
    arrow-up
    82
    arrow-down
    2
    ·
    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

    • Murdoc@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      8
      arrow-down
      1
      ·
      3 months ago

      I came here to say this. I don’t really do networking so I don’t have much care for this issue, but the clarity of the explanation was enjoyable. Plus I learned a couple of little things too.

  • notabot@lemm.ee
    link
    fedilink
    arrow-up
    65
    arrow-down
    4
    ·
    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.

    • renzev@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      24
      arrow-down
      4
      ·
      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
        14
        ·
        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
          5
          ·
          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
        6
        arrow-down
        2
        ·
        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
          5
          ·
          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
            4
            arrow-down
            2
            ·
            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
              4
              arrow-down
              2
              ·
              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
                4
                ·
                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
                  3
                  ·
                  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.

      • notabot@lemm.ee
        link
        fedilink
        arrow-up
        15
        arrow-down
        2
        ·
        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
            3
            ·
            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
              1
              ·
              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
                2
                ·
                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.

    • corsicanguppy@lemmy.ca
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      2
      ·
      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
        9
        ·
        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
          4
          ·
          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.

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

            Oh agreed entirely. You can also use different execution strategies to mitigate most performance issues, but it can require some tuning at full enterprise scale.

      • notabot@lemm.ee
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        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.

    • jonne@infosec.pub
      link
      fedilink
      arrow-up
      3
      ·
      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
        3
        ·
        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.

    • BCsven@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      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

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

        Having consistent interface names on servers that have several is useful, but we already had that option. The interface names they generate are not only hard to remember, but not terribly useful as they’re based on things like which PCI slot they’re in, rather than what their purpose is. You want interface names like wan0 and DMZ, not enp0s2. Of course, you can set it up to use useful names, but it’s more complicated than it used to be, so while the systemd approach looks like a good idea on the surface, it’s actually a retrograde step.

  • Arthur Besse@lemmy.ml
    link
    fedilink
    English
    arrow-up
    24
    ·
    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 😂

  • bitwaba@lemmy.world
    link
    fedilink
    arrow-up
    21
    ·
    3 months ago

    “the order in which the system discovered it” is not deterministic

    This is the same problem they had with hard drive names and it seems to have been solved in a sensible way, i.e. /dev/sda still points to the first disk detected by the system, but you can look look in /dev/disk/by-path (or by-uuid, etc) to see the physical address of the devices on the system and what they are symlinked back to, and set your fstab or mdadm arrays to be configured based on those unique identifiers instead.

    So, I guess what I’d like to know is why hasn’t this been solved the same way? When you boot up they should present every hard wired Ethernet port as ethX, and the hardware address interface should be present as well but aliased back to the eth. Then you can build the your network configs based on either one.

    Shouldn’t be that hard right?

    • lemmyvore@feddit.nl
      link
      fedilink
      English
      arrow-up
      6
      ·
      3 months ago

      But nobody uses /dev/sdX anymore (not after they wipe the wrong disk once anyway). They either use logical UUIDs or hardware WWN/serial.

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

        idk man I use /dev/sdX when running commands interactively and PARTLABELs in my /etc/fstab. All those letters and numbers in UUIDs are too much for my monkey brain to handle lol

      • bitwaba@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        3 months ago

        Yeah, the point is “you can use either one”, instead of “we made the choice for you”

    • thisisnotgoingwell@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      3 months ago

      As a data center engineer of 10+ years, I struggled to understand this at first. In my world, the hardware does a POST before the OS boots and has an inventory of what hardware components are available, so it shouldn’t matter in what order they are discovered, since the interface names should make a correlation between the interface and the pcie slot that NIC exists in.

      Where the water gets muddled is in virtualized servers. The NICs no longer have a correlation to a specific hardware component, and you may need to configure different interfaces in the virtualized OS for different networks. I think in trying to create a methodology that is agnostic to bare metal/virtualized OSs, it was decided that the naming convention should be uniform.

      Probably seems like bloat to the average admin who is unconcerned with whether these NICs are physical or virtual, they just want to configure their server.

    • jj4211@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      3 months ago

      And at least in some distributions, they do exactly that, a number of aliases for the same interface. And you can add your own.

    • renzev@lemmy.worldOP
      link
      fedilink
      arrow-up
      26
      ·
      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

  • maxinstuff@lemmy.world
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    1
    ·
    edit-2
    3 months ago

    Here I am on a laptop with no ethernet ports (probably works over USB-C? No idea, haven’t tried), and a single wifi adapter. Guess I’ll give it a try:

    ip link show

    What I expected

    wlan0

    What I got

    wlp242s0

    Neat 👍 😎 👍

  • NutWrench@lemmy.world
    link
    fedilink
    arrow-up
    10
    ·
    3 months ago

    Also, make sure your password contains L’s, 1’s, 0’s and O’s in a font deliberately chosen to make them hard to tell apart.

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

      And commas! To mess with the CSV file that it will inevitably be dumped into!

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    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
      6
      arrow-down
      1
      ·
      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.

  • 🐍🩶🐢@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    3 months ago

    I had to change mine to mac address naming on my proxmox server after the second time the name changed due to a GPU or SSD being added. It was kind of like, so what, if an SSD dies suddenly or I have some issue with a device you are going to rename my fucking nic card again while I am trying to troubleshoot? Absolutely deranged.

  • neclimdul@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    3 months ago

    I really appreciate this change. Prior to it was always a struggle to deploy servers successfully. You’d reboot and your database would be on the wrong interface and you could even remote in because the management interface was suddenly on a firewalled external only network. Ask me how I know.

    With virtualization and containers this just got more complicated. I would constantly have to rewrite kvm entire configs because I’d drop a new nic in the machine. A nightmare.

    Sure, it’s gibberish for the desktop user but you can just use the UI and ignore the internal name. Not even sure the last time I saw it on my laptop. So no big deal.