Skip to content

Add iproute2 package for JSON output from ip -j a #138

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

Merged
merged 2 commits into from
Jul 7, 2025

Conversation

jandubois
Copy link
Member

Added unconditionally to all editions because in the future Lima will depend on it (lima-vm/lima#3696).

It is also part of the default Alpine cloud image.

(PR also includes some minor unrelated refactoring)

jandubois added 2 commits July 7, 2025 10:23
Added unconditionally to all editions because in the future Lima will
depend on it (it is also part of the default Alpine cloud image).

Ref lima-vm/lima#3696

Signed-off-by: Jan Dubois <[email protected]>
Signed-off-by: Jan Dubois <[email protected]>
@jandubois jandubois requested a review from a team July 7, 2025 17:28
@afbjorklund
Copy link
Member

Was this to avoid having to parse the text output from ip a show?

@jandubois
Copy link
Member Author

Was this to avoid having to parse the text output from ip a show?

Yes, it is to get ip -j working. Works with routing tables too:

❯ l shell alpine ip -j route | jq '.[] | select(.dst == "default")'
{
  "dst": "default",
  "gateway": "192.168.5.2",
  "dev": "eth0",
  "protocol": "dhcp",
  "prefsrc": "192.168.5.15",
  "metric": 1002,
  "flags": [],
  "metrics": [
    {
      "mtu": 1500
    }
  ]
}

Seems more robust, and every modern Linux distro has iproute2 including the Alpine Cloud images published by upstream.

@afbjorklund
Copy link
Member

afbjorklund commented Jul 7, 2025

Why not, we add some other creature comforts like bash (at least the emulated version of it).

I'm still reaching for ifconfig :-)

@jandubois jandubois merged commit 56a04bc into lima-vm:main Jul 7, 2025
2 checks passed
@jandubois jandubois deleted the iproute2 branch July 7, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants