NixOS Networking | 909 Members | |
| Declaratively manage your switching, routing, wireless, tunneling and more. | 272 Servers |
| Sender | Message | Time |
|---|---|---|
| 23 Jun 2021 | ||
| * Does anyone have some nice tips/tricks to dealing with the systemd-networkd limits on length of interface names? I want to autoconfigure interfaces in certain ways, but sometimes they go over the limit (and get a fairly silent failure in The interface names I was configuring are essentially a combination a container name + bridge name, obviously a short workaround would be to just force the name down to 15 characters, but if the container name is long then potentially I could have naming conflicts for interfaces for different bridges :/, one solution would be to reduce the container name/bridge names to 6 or 7 chars each for interface configuration but that is also a bit messy :( | 15:15:48 | |
| IFNAMSIZ is limit in the kernel though | 15:16:03 | |
| * IFNAMSIZ is a limit in the kernel, not networkd | 15:16:45 | |
| ok, is there any way to increase that? if not then I still need to figure out a clean workaround (hence the request for tips/tricks) | 15:19:27 | |
on wlan APs i usually use radioN_vlanXXXX and that neatly works 😂 | 15:19:43 | |
| in theory there is IFALIAS | 15:20:48 | |
* in theory there is IFALIAS: ip link set alias somethinglongerthanfiveteencharacters dev lo | 15:21:17 | |
| you can also patch your kernel, but YMMV :> | 15:21:41 | |
| yeah, should be pretty straightforward with nixos, and I would really like to know where this breaks :D | 15:22:12 | |
| hm, since it's part of uapi, it also won't help much, you'll also need to rebuild the world against patched kernel headers :> | 15:22:54 | |
| guess hacking the names down to 15 characters then setting an alias is the sanest solution? might need to add some assertions to ensure i don't get conflicting interface names after trimming the names | 15:24:49 | |
| 15:24:51 | |
| tbh, I don't know how to use aliases | 15:25:07 | |
| and whether any client software allows you to reference them | 15:25:22 | |
In reply to @kraftnix:matrix.orgyou could calculate a crc or some hash with 15 characters output, to reduce collisions. | 15:25:49 | |
ifname = s: builtins.substr 0 14 (builtins.hashString "sha256" s) | 15:26:31 | |
| you could also just use the interface index instead of the name. I'm sure that's equally convenient. | 15:26:48 | |
| although that's using hexadecimal so there's a lot of room for improvements | 15:27:06 | |
| It seems that when you let systemd-nspawn create network zones for you, it auto trims + adds an alias/altname, not sure how other things interact with the altname though
| 15:27:07 | |
| 15:28:09 | |
| not sure how to use that as a selector, too lazy to read the man page | 15:28:30 | |
| still seems like a PIA :/ | 15:28:46 | |
| heres me wishing for a magic solution that perfectly fits my usecase | 15:29:11 | |
does systemd-networkd ever clean up networks that have been removed from systemd.network.networks without rebooting the entire machine? can you make it do a full reconfiguration without reboot or cleanup old networks manually? | 23:56:40 | |
| 24 Jun 2021 | ||
| 03:42:30 | ||
In reply to @kraftnix:matrix.orgNo it only adds stuff. | 16:02:33 | |
| I have mixed feelings about that. Sometimes I prefer it this way. | 16:02:58 | |
| Would be nice if you could manually "flush" old devices/networks but oh well, I guess I'll just need to be careful not to change network names but maintain the same ipspace/subnet, i've had some weirdness with that (and noticed the old netdevs/works were not cleaned up). | 17:50:51 | |
| 25 Jun 2021 | ||
| I wonder if netplan solves any of these issues. But I guess not because than they would need to reimplement a lot of what networkd does. | 07:04:34 | |
| 26 Jun 2021 | ||
| 01:30:07 | ||