I made this script - Podman network IP inspector: list containers, IPs, subnets with colors and tree view #29575
upmcplanetracker
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
https://github.com/upmcplanetracker/podman-ip-inspector
If anyone tries it out, feedback is appreciated. Thanks.
podman-ip-inspectoris a Bash script that queries your Podman environment and presents a clear overview of all user-defined networks, their subnets, attached containers, and the IP addresses assigned to each container (both IPv4 and IPv6). It works with rootless Podman (default) and rootful Podman (if you run withsudo).The output can be shown as:
-m), and-u).All views are color‑coded for quick visual scanning, and a duplicate subnet warning is displayed automatically to help you avoid routing conflicts.
Features
-m) - hierarchical view of networks with containers indented.-u) - shows how many IPv4 addresses are used vs. available per network.-n) or container (-c) - show only what you need.sudoto inspect rootful containers.podman,jq, and optionallyperl(for colors).Installation
Save the script (e.g.,
podman-ip-inspector) in your$PATH(e.g.,~/.local/bin/).Make it executable:
Ensure dependencies are installed:
Run it:
Usage
Examples
1. Full table view (default)
Sample output:
2. Tree view (
-m)Sample output:
3. Usage summary (
-u)Outputs the table plus:
4. Filter by network (
-n)5. Filter by container (
-c)6. Rootful Podman
Color Coding
Colors are auto‑detected if your terminal supports them. You can force
--coloror disable with--no-color.Notes
podmancommand from the user's environment. When run withoutsudo, it shows rootless containers. When run withsudo, it shows rootful containers. All features work identically in both modes.jqis required for parsing JSON output.perlis optional but recommended for coloring; if absent, colors are automatically disabled.10.89.0.0/24), a warning is printed. This is a common misconfiguration that can cause routing issues especially upon startup due to race conditions.All reactions