Bug 233554 - ifconfig - Add feature to list interfaces summary.
Summary: ifconfig - Add feature to list interfaces summary.
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-27 06:36 UTC by Santiago Martinez
Modified: 2023-06-05 20:57 UTC (History)
3 users (show)

See Also:


Attachments
File contains output of ifconfig -s on a system used multiple interfaces. (1.57 KB, text/plain)
2018-11-27 06:36 UTC, Santiago Martinez
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Santiago Martinez 2018-11-27 06:36:23 UTC
Created attachment 199594 [details]
File contains output of ifconfig -s on a system used multiple interfaces.

Hi FreeBSD team,

What:

This is an enhancement request. Just wondering what is your view on adding a new flag/feature to ifconfig to provide a summary of the network interfaces including admin state, media status, description and maybe something else in a table based format ( Yes like a cisco "show interface status" or any of those..). 

If I'm not wrong at the moment there is not such feature and when working with many interfaces (like 10's of jails using Vimage) it becomes quite difficult to track interface and bridges status.

Status:

I been playing around with ifconfig and put together a status_summary() function that generates the following, but is too poor in code quality and features. So just wondering if somebody is interested on coding it or maybe point me in the right direction to code it.

I've included a file with the current output of the -s (summary) function I added. It can be used with the existing flags ( -d -u $ifname).

Regards.

Santiago Martinez
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2018-11-27 18:26:29 UTC
Maybe you can write a small program to do what you want using libifconfig?  https://github.com/freebsd/freebsd/tree/master/lib/libifconfig
Comment 2 Alexander V. Chernikov freebsd_committer freebsd_triage 2023-06-05 12:54:35 UTC
I'd say that ability to provide the "concise" view of the large number of interfaces is a desired thing.
However, there are many different variations of how this "concise" view should look like and what should it contain. Even across the vendors (Cisco vs Juniper, for example), the outputs varies.
I'd rather invest in the solution that allows to construct these views easily. For example, enhancing ifconfig(8) with libxo may provide easily-parsable json output that can be used to construct the view shown above. To my knowledge, we don't have it funded, so I'm not sure if it can happen anytime soon.

If you have a different approach in mind, or have some patches, or are considering to support of the feature development, please feel free to discuss.
Comment 3 Santiago Martinez 2023-06-05 19:28:13 UTC
Hi there,  

Yes I agree, we need something easier to read when dealing with multiple interfaces. I'm not sure which is the correct format, but what we have right now makes it difficult, especially when using FBSD as a hypervisor or jails with vnets + with bridges + tunnels + xyz.

Adding libxo will be great, I have started adding some parts but then I moved to something else, which I cannot remember anymore :). 

I have the patches that generate the output attached to the first messages, but it's just a dirty copy/paste hack.
Comment 4 Alexander V. Chernikov freebsd_committer freebsd_triage 2023-06-05 20:09:36 UTC
(In reply to Santiago Martinez from comment #3)
Would you be interested in participating in libxo'ing ifconfig? I can come up with a basic diff that adds libxo & structured output for some core things (structure around interfaces / addresses).
Comment 5 Mina Galić freebsd_triage 2023-06-05 20:57:16 UTC
i put this on my todo list for my cloud-init project, but that has exploded in complexity and scope, so I'd be very happy to not do that ;)