Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort loopback first in show interfaces #545

Closed
troglobit opened this issue Jul 25, 2024 · 2 comments
Closed

Sort loopback first in show interfaces #545

troglobit opened this issue Jul 25, 2024 · 2 comments
Assignees

Comments

@troglobit
Copy link
Contributor

I propose sorting interfaces in show interfaces such that lo is always displayed first. It is the only interface that all systems will have and also the order in which standard Linux/UNIX tools display interfaces.

Consider even listing all interfaces in ifindex order.

@wkz
Copy link
Contributor

wkz commented Jul 29, 2024

Some thoughts:

  • lo on top sounds good to me
  • ifindex is roughly equivalent to the hardware probe order, which is rarely the most intuitive order to view stuff in. I don't think we want to rely on that when sorting

Today, we try convey interface hierarchy when possible (bridge ports are listed "under" their bridge, vlans are stacked on top of their lowers, etc). If we want to find some other sort order, we need to think about the implications on this feature. One option would be to have a separate command that lists interfaces with hierarchy indications, and that show interfaces outputs a flat table. In that case the sort key could be iftype (where we could rank loopbacks highest), with ifname as the tiebreaker within each type.

@troglobit
Copy link
Contributor Author

Good point, I had forgotten about the weird probe order thing.

I think the current hierarchy view of show interfaces is great! we already have show ip [brief|detailed|multicast] command, so maybe that's sufficient for all other use-cases?

@mattiaswal mattiaswal self-assigned this Aug 14, 2024
mattiaswal added a commit that referenced this issue Aug 14, 2024
This fixes #545

Signed-off-by: Mattias Walström <[email protected]>
mattiaswal added a commit that referenced this issue Aug 14, 2024
This fixes #545

Signed-off-by: Mattias Walström <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants