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
Maybe you can write a small program to do what you want using libifconfig? https://github.com/freebsd/freebsd/tree/master/lib/libifconfig
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.
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.
(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).
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 ;)