2015-09-28 21:57:03 -04:00
<!-- [metadata]>
+++
title = "network inspect"
description = "The network inspect command description and usage"
2015-09-30 16:11:36 -04:00
keywords = ["network, inspect, user-defined"]
2015-09-28 21:57:03 -04:00
[menu.main]
parent = "smn_cli"
+++
<![end-metadata]-->
# network inspect
2015-10-18 19:47:32 -04:00
Usage: docker network inspect [OPTIONS] NETWORK [NETWORK..]
2015-09-28 21:57:03 -04:00
Displays detailed information on a network
2015-12-02 16:32:10 -05:00
-f, --format= Format the output using the given go template.
2015-12-23 09:37:06 -05:00
--help Print usage
2015-09-28 21:57:03 -04:00
2015-12-27 23:56:57 -05:00
Returns information about one or more networks. By default, this command renders all results in a JSON object. For example, if you connect two containers to the default `bridge` network:
2015-09-28 21:57:03 -04:00
2015-10-18 19:47:32 -04:00
```bash
2015-09-28 21:57:03 -04:00
$ sudo docker run -itd --name=container1 busybox
f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27
$ sudo docker run -itd --name=container2 busybox
bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727
2015-10-18 19:47:32 -04:00
```
2015-12-02 16:32:10 -05:00
The `network inspect` command shows the containers, by id, in its
2016-03-12 16:29:25 -05:00
results. For networks backed by multi-host network driver, such as Overlay,
this command also shows the container endpoints in other hosts in the
cluster. These endpoints are represented as "ep-{endpoint-id}" in the output.
You can specify an alternate format to execute a given
2015-12-02 16:32:10 -05:00
template for each result. Go's
[text/template ](http://golang.org/pkg/text/template/ ) package describes all the
details of the format.
2015-09-28 21:57:03 -04:00
2015-10-18 19:47:32 -04:00
```bash
2015-09-28 21:57:03 -04:00
$ sudo docker network inspect bridge
2015-10-18 19:47:32 -04:00
[
2015-11-20 06:41:25 -05:00
{
"Name": "bridge",
"Id": "b2b1a2cba717161d984383fd68218cf70bbbd17d328496885f7c921333228b0f",
"Scope": "local",
"Driver": "bridge",
"IPAM": {
"Driver": "default",
"Config": [
{
"Subnet": "172.17.42.1/16",
"Gateway": "172.17.42.1"
}
]
},
2016-01-15 02:31:12 -05:00
"Internal": false,
2015-11-20 06:41:25 -05:00
"Containers": {
"bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727": {
"Name": "container2",
"EndpointID": "0aebb8fcd2b282abe1365979536f21ee4ceaf3ed56177c628eae9f706e00e019",
"MacAddress": "02:42:ac:11:00:02",
"IPv4Address": "172.17.0.2/16",
"IPv6Address": ""
},
"f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27": {
"Name": "container1",
"EndpointID": "a00676d9c91a96bbe5bcfb34f705387a33d7cc365bac1a29e4e9728df92d10ad",
"MacAddress": "02:42:ac:11:00:01",
"IPv4Address": "172.17.0.1/16",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
}
}
2015-10-18 19:47:32 -04:00
]
2015-09-28 21:57:03 -04:00
```
2015-10-18 19:47:32 -04:00
2015-12-27 23:56:57 -05:00
Returns the information about the user-defined network:
```bash
$ docker network create simple-network
69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a
$ docker network inspect simple-network
[
{
"Name": "simple-network",
"Id": "69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a",
"Scope": "local",
"Driver": "bridge",
"IPAM": {
"Driver": "default",
"Config": [
{
"Subnet": "172.22.0.0/16",
"Gateway": "172.22.0.1/16"
}
]
},
"Containers": {},
"Options": {}
}
]
```
2015-10-18 19:47:32 -04:00
## Related information
* [network disconnect ](network_disconnect.md )
* [network connect ](network_connect.md )
* [network create ](network_create.md )
* [network ls ](network_ls.md )
* [network rm ](network_rm.md )
* [Understand Docker container networks ](../../userguide/networking/dockernetworks.md )