5 ms·
Mac OS X and Linux are the only OS's that I'm aware of that put all ethernet nics in the same device namespace. Everyone else has separate device namespaces fo
by zdw 16y ago
Mac OS X and Linux are the only OS's that I'm aware of that put all ethernet nics in the same device namespace.
Everyone else has separate device namespaces for - you might have an fxp0 , rl0, hme0, etc. on any BSD or Solaris machine.
Rather than looking in /dev, they really ought to be parsing the output of ifconfig -a.
- CrLf 16y agoHaving all ethernet devices called "ethX" makes it much easier to parse the output of ifconfig and exclude any non-ethernet interfaces (tunnels and such).
- andrewf 16y agoMy primary network interface has just become "en0" again, after being "en1" for about 8 years (the time between my first iBook with 802.11b, and getting a MacBook Air which doesn't have an ethernet port).
- nailer 16y ago1. Linux gives unique names to each NIC. There are no namespace conflicts, because each NIC alias is unique within devices. I personally do not care about the chipset manufacturer and driver when working on a routing issue. 2. You mean (IIRC) 'ip link show'. ifconfig on linux isn't maintained, and breaks in a bunch of situations (Aliases on VLANs on bonds, for one) 3. And you should of course use python-procfs or your preferred equiv, not parse the output of other tools. On the article in general: can't you use /dev/by-manufacturer these days or similar? I haven't been working on OS stuff recently so can't remember if that became standard.
- ominous_prime 16y agosomewhat OT: > 2. You mean (IIRC) 'ip link show'. ifconfig on linux isn't maintained, and breaks in a bunch of situations (Aliases on VLANs on bonds, for one) This seemingly simple change seems to be taking forever to gain traction; "use `ip` for network config on linux". There is so much googlable stuff instructing one to use ifconfig, route, etc. that it seems to self perpetuate. I often find people telling others that "you can't do that in Linux", when the real answer is along the lines of "you can't do that with the route command" (to give an example that I've seen a few times recently, route can't manipulate routing tables)
- zdw 16y agoIt's not that it self-perpetuates, it's that nearly every other Unix does it that way, and thus there's an expectation that ifconfig, if it exists, has similar functionality on all platforms. If you're going to deprecate a command, make running the old one either: 1. Not exist, and thus have the shell throw an "command not found" error 2. Print a useful message like "Use <newcommand> instead" 3. Work, but do #2 as well. The current situation is like leaving a pair of rusty pliers out in the open, and hiding the brand new socket set when the goal is tightening a bunch of bolts.
- vdm 16y agoLove the tools analogy! So true. LOL
- nailer 16y agoYeah, the Linux distros (which themselves obviously only use 'ip') should have done #2 10 years ago. When I worked at Red Hat (till 2005) their official RHCE documentation still told people to use ifconfig and route.
- ominous_prime 16y agoI agree wholeheartedly that the old tools should be hidden away, and I assume that they haven't been, because that will break more things than the actual renaming of devices. I bet even adding deprecation warnings could cause a ruckus, seeing how many times I've come across `ifconfig | something` both in scripts and people shelling out from other languages. I do wish the distros would just make a clean break, and let people fix their crappy code.
- kelnos 16y agoThen you just make the deprecation warning go to stderr instead of stdout. '|' only redirects stdout.
- ominous_prime 16y ago
- deleted 16y ago[deleted]