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

cli: improve 'show interfaces' to list container networks #626

Closed
troglobit opened this issue Sep 13, 2024 · 2 comments · Fixed by #783
Closed

cli: improve 'show interfaces' to list container networks #626

troglobit opened this issue Sep 13, 2024 · 2 comments · Fixed by #783
Assignees
Labels
enhancement New feature or request

Comments

@troglobit
Copy link
Contributor

Take this example:

admin@infix-00-00-00:/> show interfaces 
INTERFACE       PROTOCOL   STATE       DATA
---------------------------------------------------------------------
lo              ethernet   UP          00:00:00:00:00:00
                ipv4                   127.0.0.1/8 (static)
                ipv6                   ::1/128 (static)
br0             bridge
│               ethernet   UP          02:00:00:00:00:00
│               ipv4                   169.254.1.3/16 (random)
│               ipv4                   192.168.122.160/24 (dhcp)
├ e1            bridge     FORWARDING
└ veth0b        bridge     FORWARDING
veth0a          ethernet
veth0b          ethernet   UP          32:ed:2e:8b:17:9f

A simple setup with a bridge and a VETH pair. One end of the VETH pair is set as bridge port, but where's the other one?

Could it be in a container?

admin@infix-00-00-00:/> exit
admin@infix-00-00-00:~$ sudo container --net veth0a locate
system

There it was!


Proposed output:

admin@infix-00-00-00:/> show interfaces 
INTERFACE       PROTOCOL   STATE       DATA
---------------------------------------------------------------------
lo              ethernet   UP          00:00:00:00:00:00
                ipv4                   127.0.0.1/8 (static)
                ipv6                   ::1/128 (static)
br0             bridge
│               ethernet   UP          02:00:00:00:00:00
│               ipv4                   169.254.1.3/16 (random)
│               ipv4                   192.168.122.160/24 (dhcp)
├ e1            bridge     FORWARDING
└ veth0b        bridge     FORWARDING
veth0a          ethernet               container:system
veth0b          ethernet   UP          32:ed:2e:8b:17:9f

More information about a running container's network interfaces can be dumped using sudo podman inspect system | jq -r '.[].NetworkSettings.Networks. Unfortunately that command does not list the name of the interfaces inside the container. For that nsenter is needed, then inspecting all interfaces and comparing their ifname to their ifalias.

@troglobit troglobit added enhancement New feature or request triage Pending investigation & classification (CCB) labels Sep 13, 2024
@troglobit troglobit added this to the Infix v24.10 milestone Oct 1, 2024
@troglobit troglobit removed the triage Pending investigation & classification (CCB) label Oct 1, 2024
@troglobit troglobit moved this to Todo in Infix & C:o Oct 1, 2024
@rical
Copy link
Contributor

rical commented Oct 15, 2024

For future reference. Here's the philosophy behind the columns in show interfaces.

Image

Basically this dictates that STATE and DATA depends on PROTO. It's not just a free text data field. For example, PTOTO == ipv4 dictates that the data is an IPv4 Address, or other data related to IPv4 addresses. There's some exceptions to this. But generally this is what we aim at.

@troglobit troglobit linked a pull request Nov 3, 2024 that will close this issue
17 tasks
@troglobit
Copy link
Contributor Author

Fixed in #783.

@github-project-automation github-project-automation bot moved this from Todo to Done in Infix & C:o Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants