News for hackers. Stuff that matters.
Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by kasabali on Tuesday October 04, 2022 @08:38PM (#33089365)
Why would they want to run that abomination in FreeBSD?
Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by f1shy on Wednesday October 05, 2022 @01:43AM (#33091730)
That was exactly my thought, specially after reading another answer:

> "ip addr show" lists interfaces and their stats. It's harder to read than ifconfig -a but gives you the same information in a similar format.

> "ip route show" replaces netstat -rn to show the routing table but is also not as well formatted as the old command.

> So basically it combines a bunch of commands (including ifconfig) into one and gives them all a unified interface.

To me sounds like same but worse, and combining 10 commands into 1 seems to be totally against the unix philosophy "it should do one thing, and do it properly"

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by zokier on Wednesday October 05, 2022 @02:11AM (#33091905)
> To me sounds like same but worse, and combining 10 commands into 1 seems to be totally against the unix philosophy "it should do one thing, and do it properly"

The "one thing" ip essentially does is working with NETLINK_ROUTE protocol; it is relatively thin wrapper exposing that to shell.

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by icehawk on Wednesday October 05, 2022 @02:56AM (#33092154)
And its far more consistent to deal with.

v6 works like v4, arp and ndp work the same (down to subcommand to invoke them: they're under "neighbor") everything uses the same verbiage: add/delete/change/set.

none of this sillyness where you need one command to show the routing table 'netstat -rn' and another to manipulate the routing table 'route add/delete/change' (and then v4 uses -mask and v6 uses -prefixlen, etc etc)

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by akira2501 on Wednesday October 05, 2022 @03:37AM (#33092438)
Also, vlans and bridges.. and vlans _on_ bridges. tap interfaces? Yup!

Flattening everything and then making it available through the 'verb' syntax is an absolute joy to work with, especially if you're doing time sensitive work or trying to debug a test setup.

The CLI flows like a language, and you find yourself guessing at new "phrases" that very often _don't_ summon demons and actually do what you expected. I like it so much, I emulate it whenever it makes sense to do so for my own CLI tools.

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by justsomehnguy on Wednesday October 05, 2022 @10:47PM (#33103756)
Working with Windows, Linux, FreeBSD, switches all the time I still occasionally try to `ipconfig` on non-Windows machines, `ip addr` on BSD and I'm still try to `route print` before remembering it's `netstat -nr`.

`ip` is ugly (especially it's help system or more like lack of it) but works and pretty consistent.

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by jeltz on Wednesday October 05, 2022 @12:49PM (#33097988)
Having used both I would say ip is the same thing but better. The old tools are inconsistent and often do not show all info you need.
Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by agapon on Wednesday October 05, 2022 @01:48AM (#33091763)
Note that "netlink support" != "ip command". In fact, ip command hasn't been added and I haven't heard of any plans to do so.
Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by Hikikomori on Wednesday October 05, 2022 @05:55AM (#33093333)
Following the unix philosophy we should have one command to manage physical interfaces, another for ethernet level stuff, separate commands to manage ipv4 and ipv6 addresses, then v4 and v6 multicast, another for vlans, different ones for v4 and v6 route tables, and so on, all with an inconsistent cli interface and output.

As a network engineer pre-ip linux was a disaster, while ip is a joy to work with.

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by nmz on Wednesday October 05, 2022 @09:31AM (#33095330)
Unix programs should stop worrying about how something looks, just spit out csv and let anyone pipe into a pretty printer. If its properly formatted you can make it look however you want.
Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by kevans91 on Tuesday October 04, 2022 @11:08PM (#33090637)
IMO it was just a relatable example of a somewhat extensive user of netlink that demonstrates compatibility. Some folks may want to run it under the Linuxolator, which seems reasonable.

I only have limited knowledge about netlink, all coming from a devsummit presentation by Alexander, but it seems like an actually good generic kernel interface to have.

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by stefan_ on Tuesday October 04, 2022 @11:19PM (#33090739)
It really isn't. It's like someone wanted to add protobufs for kernel interfaces, but everything has not one tenth of the usability. In fact it's the kind of thing someone would design who wanted to make it's use in C maximally painful and error prone.
Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by eqvinox on Wednesday October 05, 2022 @12:50AM (#33091390)
Working with both netlink and protobufs in C for 10+ years, I gotta say the latter is much more painful than the former. Error prone I would agree though, mostly because it's too easy to implement netlink… and get it wrong in the process.

NB: my experience specifically relates to C. Protobuf's bindings to other languages are better.

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by tuetuopay on Wednesday October 05, 2022 @05:07AM (#33093036)
There are a lot of nice things with netlink. This provides a unified interface to the whole networking stack, where everything is consistent.

To me, the main advantage of netlink is the multicast mode, where you can subscribe to certain class of events. e.g. route add, neighbor add, etc.

Also, a lot of linux software for the networking domain interfaces with netlink, so they gain freebsd compatibility for, well, free. For example, you get FRR compat now.

Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by mnd999 on Wednesday October 05, 2022 @02:50AM (#33092125)
I can’t comment on netlink but there does seem to be a lack of innovation in FreeBSD of late. Everything has to be done the same way Linux does it or there’s little adoption and at that point you might as well just use Linux. There has to be some differentiation or why bother?
Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by chris_wot on Tuesday October 04, 2022 @11:41PM (#33090906)
What is wrong with it?
Re:Netlink Added to FreeBSD – Unmodified Linux IP(8) Correct... by f1shy on Wednesday October 05, 2022 @01:44AM (#33091740)
See my answer to the parent comment.