mirror of
https://github.com/containers/podman.git
synced 2025-05-17 06:59:07 +08:00

Like docker podman network inspect should output the information of running container with their ip/mac address on this network. However the output format is not docker compatible as this cannot include all the info we have and the previous output was already not compatible so this is not new. New example output: ``` [ { ... "containers": { "7c0d295779cee4a6db7adc07a99e635909413a390eeab9f951edbc4aac406bf1": { "name": "c2", "interfaces": { "eth0": { "subnets": [ { "ipnet": "10.89.0.4/24", "gateway": "10.89.0.1" }, { "ipnet": "fda3:b4da:da1e:7e9d::4/64", "gateway": "fda3:b4da:da1e:7e9d::1" } ], "mac_address": "1a:bd:ca:ea:4b:3a" } } }, "b17c6651ae6d9cc7d5825968e01d6b1e67f44460bb0c140bcc32bd9d436ac11d": { "name": "c1", "interfaces": { "eth0": { "subnets": [ { "ipnet": "10.89.0.3/24", "gateway": "10.89.0.1" }, { "ipnet": "fda3:b4da:da1e:7e9d::3/64", "gateway": "fda3:b4da:da1e:7e9d::1" } ], "mac_address": "f6:50:e6:22:d9:55" } } } } } ] ``` Fixes #14126 Fixes https://issues.redhat.com/browse/RHEL-3153 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2.7 KiB
2.7 KiB
% podman-network-inspect 1
NAME
podman-network-inspect - Display the network configuration for one or more networks
SYNOPSIS
podman network inspect [options] network [network ...]
DESCRIPTION
Display the (JSON format) network configuration.
OPTIONS
--format, -f=format
Pretty-print networks to JSON or using a Go template.
Placeholder | Description |
---|---|
.Containers ... | Running containers on this network. |
.Created ... | Timestamp when the network was created |
.DNSEnabled | Network has dns enabled (boolean) |
.Driver | Network driver |
.ID | Network ID |
.Internal | Network is internal (boolean) |
.IPAMOptions ... | Network ipam options |
.IPv6Enabled | Network has ipv6 subnet (boolean) |
.Labels ... | Network labels |
.Name | Network name |
.Network ... | Nested Network type |
.NetworkDNSServers | Array of DNS servers used in this network |
.NetworkInterface | Name of the network interface on the host |
.Options ... | Network options |
.Routes | List of static routes for this network |
.Subnets | List of subnets on this network |
EXAMPLE
Inspect the default podman network.
$ podman network inspect podman
[
{
"name": "podman",
"id": "2f259bab93aaaaa2542ba43ef33eb990d0999ee1b9924b557b7be53c0b7a1bb9",
"driver": "bridge",
"network_interface": "podman0",
"created": "2021-06-03T12:04:33.088567413+02:00",
"subnets": [
{
"subnet": "10.88.0.0/16",
"gateway": "10.88.0.1"
}
],
"ipv6_enabled": false,
"internal": false,
"dns_enabled": false,
"ipam_options": {
"driver": "host-local"
}
}
]
Show the subnet and gateway for a network.
$ podman network inspect podman --format "{{range .Subnets}}Subnet: {{.Subnet}} Gateway: {{.Gateway}}{{end}}"
Subnet: 10.88.0.0/16 Gateway: 10.88.0.1
SEE ALSO
podman(1), podman-network(1), podman-network-ls(1), podman-network-create(1)
HISTORY
August 2021, Updated with the new network format by Paul Holzinger pholzing@redhat.com
August 2019, Originally compiled by Brent Baude bbaude@redhat.com