915
submitted 1 week ago by [email protected] to c/[email protected]

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

top 50 comments
sorted by: hot top controversial new old
[-] [email protected] 31 points 6 days ago

As someone who worked on a pre-systemd linux system with multiple NICs and needed them all configured automatically from an OS image based on where it was in the rack, I can't stress enough how good deterministic interface names are.

Booting up a system and each time having different names for each NIC was a nightmare.

Frankly 90+% of what systemd has done is tremendously positive and makes linux a better operating system to use, both for sys admins and end users.

[-] [email protected] 3 points 6 days ago

Couldn't they be configured to always set each interface to a particular name? I'd think that would be the better solution anyway...

[-] [email protected] 28 points 6 days ago

eth0? No no, we need wlps0n1pn2d4es6vsd9c69420

[-] [email protected] 31 points 6 days ago

I actually prefer the eth0 and wlan0.

[-] [email protected] 22 points 6 days ago

That's what the meme is saying too

[-] [email protected] 9 points 6 days ago
[-] [email protected] 6 points 6 days ago

This time it isn't (I think)

[-] [email protected] 3 points 6 days ago

For regular PCs or laptops, which generally have at most one of each type of adapter, I don't see any reason not to.

[-] [email protected] 20 points 6 days ago* (last edited 6 days 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 ๐Ÿ‘ ๐Ÿ˜Ž ๐Ÿ‘

[-] [email protected] 9 points 6 days ago

enp2s0, wlp3s0, and my fav enp4s0f3u1u3

[-] [email protected] 1 points 3 days ago

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

[-] [email protected] 9 points 6 days 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.

[-] [email protected] 10 points 6 days 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.

[-] [email protected] 7 points 6 days 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.

[-] [email protected] 2 points 6 days ago

life-long Kali fan

[-] fruitycoder 1 points 6 days ago

No idea what mactab is, but maybe it solves it for me, but being able to go from interface name back to a rack full of heterogeneous PCI cards and go "yep it should be this port" was a wildly useful feature.

I feel like there should be automatic alias creation for simply interface names though.

[-] [email protected] 1 points 6 days ago

Wlan1? how would you bridge different channels with only wlan0?

load more comments
view more: next โ€บ
this post was submitted on 27 Jun 2024
915 points (96.5% liked)

linuxmemes

19717 readers
323 users here now

I use Arch btw


Sister communities:

Community rules

  1. Follow the site-wide rules and code of conduct
  2. Be civil
  3. Post Linux-related content
  4. No recent reposts

Please report posts and comments that break these rules!

founded 1 year ago
MODERATORS