github.com/kim0/docker@v0.6.2-0.20161130212042-4addda3f07e7/docs/reference/commandline/network_inspect.md (about) 1 --- 2 title: "network inspect" 3 description: "The network inspect command description and usage" 4 keywords: ["network, inspect, user-defined"] 5 --- 6 7 <!-- This file is maintained within the docker/docker Github 8 repository at https://github.com/docker/docker/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 # network inspect 17 18 ```markdown 19 Usage: docker network inspect [OPTIONS] NETWORK [NETWORK...] 20 21 Display detailed information on one or more networks 22 23 Options: 24 -f, --format string Format the output using the given Go template 25 --help Print usage 26 ``` 27 28 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: 29 30 ```bash 31 $ sudo docker run -itd --name=container1 busybox 32 f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27 33 34 $ sudo docker run -itd --name=container2 busybox 35 bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727 36 ``` 37 38 The `network inspect` command shows the containers, by id, in its 39 results. For networks backed by multi-host network driver, such as Overlay, 40 this command also shows the container endpoints in other hosts in the 41 cluster. These endpoints are represented as "ep-{endpoint-id}" in the output. 42 However, for swarm-scoped networks, only the endpoints that are local to the 43 node are shown. 44 45 You can specify an alternate format to execute a given 46 template for each result. Go's 47 [text/template](http://golang.org/pkg/text/template/) package describes all the 48 details of the format. 49 50 ```bash 51 $ sudo docker network inspect bridge 52 [ 53 { 54 "Name": "bridge", 55 "Id": "b2b1a2cba717161d984383fd68218cf70bbbd17d328496885f7c921333228b0f", 56 "Created": "2016-10-19T04:33:30.360899459Z", 57 "Scope": "local", 58 "Driver": "bridge", 59 "IPAM": { 60 "Driver": "default", 61 "Config": [ 62 { 63 "Subnet": "172.17.42.1/16", 64 "Gateway": "172.17.42.1" 65 } 66 ] 67 }, 68 "Internal": false, 69 "Containers": { 70 "bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727": { 71 "Name": "container2", 72 "EndpointID": "0aebb8fcd2b282abe1365979536f21ee4ceaf3ed56177c628eae9f706e00e019", 73 "MacAddress": "02:42:ac:11:00:02", 74 "IPv4Address": "172.17.0.2/16", 75 "IPv6Address": "" 76 }, 77 "f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27": { 78 "Name": "container1", 79 "EndpointID": "a00676d9c91a96bbe5bcfb34f705387a33d7cc365bac1a29e4e9728df92d10ad", 80 "MacAddress": "02:42:ac:11:00:01", 81 "IPv4Address": "172.17.0.1/16", 82 "IPv6Address": "" 83 } 84 }, 85 "Options": { 86 "com.docker.network.bridge.default_bridge": "true", 87 "com.docker.network.bridge.enable_icc": "true", 88 "com.docker.network.bridge.enable_ip_masquerade": "true", 89 "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", 90 "com.docker.network.bridge.name": "docker0", 91 "com.docker.network.driver.mtu": "1500" 92 }, 93 "Labels": {} 94 } 95 ] 96 ``` 97 98 Returns the information about the user-defined network: 99 100 ```bash 101 $ docker network create simple-network 102 69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a 103 $ docker network inspect simple-network 104 [ 105 { 106 "Name": "simple-network", 107 "Id": "69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a", 108 "Created": "2016-10-19T04:33:30.360899459Z", 109 "Scope": "local", 110 "Driver": "bridge", 111 "IPAM": { 112 "Driver": "default", 113 "Config": [ 114 { 115 "Subnet": "172.22.0.0/16", 116 "Gateway": "172.22.0.1" 117 } 118 ] 119 }, 120 "Containers": {}, 121 "Options": {}, 122 "Labels": {} 123 } 124 ] 125 ``` 126 127 ## Related information 128 129 * [network disconnect ](network_disconnect.md) 130 * [network connect](network_connect.md) 131 * [network create](network_create.md) 132 * [network ls](network_ls.md) 133 * [network rm](network_rm.md) 134 * [network prune](network_prune.md) 135 * [Understand Docker container networks](https://docs.docker.com/engine/userguide/networking/)