github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/docs/reference/commandline/network_inspect.md (about) 1 <!--[metadata]> 2 +++ 3 title = "network inspect" 4 description = "The network inspect command description and usage" 5 keywords = ["network, inspect, user-defined"] 6 [menu.main] 7 parent = "smn_cli" 8 +++ 9 <![end-metadata]--> 10 11 # network inspect 12 13 ```markdown 14 Usage: docker network inspect [OPTIONS] NETWORK [NETWORK...] 15 16 Display detailed information on one or more networks 17 18 Options: 19 -f, --format string Format the output using the given go template 20 --help Print usage 21 ``` 22 23 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: 24 25 ```bash 26 $ sudo docker run -itd --name=container1 busybox 27 f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27 28 29 $ sudo docker run -itd --name=container2 busybox 30 bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727 31 ``` 32 33 The `network inspect` command shows the containers, by id, in its 34 results. For networks backed by multi-host network driver, such as Overlay, 35 this command also shows the container endpoints in other hosts in the 36 cluster. These endpoints are represented as "ep-{endpoint-id}" in the output. 37 You can specify an alternate format to execute a given 38 template for each result. Go's 39 [text/template](http://golang.org/pkg/text/template/) package describes all the 40 details of the format. 41 42 ```bash 43 $ sudo docker network inspect bridge 44 [ 45 { 46 "Name": "bridge", 47 "Id": "b2b1a2cba717161d984383fd68218cf70bbbd17d328496885f7c921333228b0f", 48 "Scope": "local", 49 "Driver": "bridge", 50 "IPAM": { 51 "Driver": "default", 52 "Config": [ 53 { 54 "Subnet": "172.17.42.1/16", 55 "Gateway": "172.17.42.1" 56 } 57 ] 58 }, 59 "Internal": false, 60 "Containers": { 61 "bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727": { 62 "Name": "container2", 63 "EndpointID": "0aebb8fcd2b282abe1365979536f21ee4ceaf3ed56177c628eae9f706e00e019", 64 "MacAddress": "02:42:ac:11:00:02", 65 "IPv4Address": "172.17.0.2/16", 66 "IPv6Address": "" 67 }, 68 "f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27": { 69 "Name": "container1", 70 "EndpointID": "a00676d9c91a96bbe5bcfb34f705387a33d7cc365bac1a29e4e9728df92d10ad", 71 "MacAddress": "02:42:ac:11:00:01", 72 "IPv4Address": "172.17.0.1/16", 73 "IPv6Address": "" 74 } 75 }, 76 "Options": { 77 "com.docker.network.bridge.default_bridge": "true", 78 "com.docker.network.bridge.enable_icc": "true", 79 "com.docker.network.bridge.enable_ip_masquerade": "true", 80 "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", 81 "com.docker.network.bridge.name": "docker0", 82 "com.docker.network.driver.mtu": "1500" 83 } 84 } 85 ] 86 ``` 87 88 Returns the information about the user-defined network: 89 90 ```bash 91 $ docker network create simple-network 92 69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a 93 $ docker network inspect simple-network 94 [ 95 { 96 "Name": "simple-network", 97 "Id": "69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a", 98 "Scope": "local", 99 "Driver": "bridge", 100 "IPAM": { 101 "Driver": "default", 102 "Config": [ 103 { 104 "Subnet": "172.22.0.0/16", 105 "Gateway": "172.22.0.1/16" 106 } 107 ] 108 }, 109 "Containers": {}, 110 "Options": {} 111 } 112 ] 113 ``` 114 115 ## Related information 116 117 * [network disconnect ](network_disconnect.md) 118 * [network connect](network_connect.md) 119 * [network create](network_create.md) 120 * [network ls](network_ls.md) 121 * [network rm](network_rm.md) 122 * [Understand Docker container networks](../../userguide/networking/dockernetworks.md)