docker:networking:inspect_a_network
Docker - Networking - Inspect a network
To view network configuration details:
docker network inspect bridge
returns:
[ { "Name": "bridge", "Id": "45df8a26c099f2a59310a10cca96f9833602153eeb48256551834bba3cdb4821", "Created": "2025-07-14T01:42:04.455631497+01:00", "Scope": "local", "Driver": "bridge", "EnableIPv4": true, "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": null, "Config": [ { "Subnet": "172.17.0.0/16", "Gateway": "172.17.0.1" } ] }, "Internal": false, "Attachable": false, "Ingress": false, "ConfigFrom": { "Network": "" }, "ConfigOnly": false, "Containers": {}, "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" }, "Labels": {} } ]
NOTE: The syntax of the docker network inspect command is docker network inspect <network>, where <network> can be either network name or network ID.
- In the example above we are showing the configuration details for the network called “bridge”.
- See: List networks to list the networks.
- Do not confuse this with the “bridge” driver.
- This shows various network-related fields like Gateway, IPAddress, and NetworkID.
- Gateway - The gateway is essentially the door through which a container can reach external networks, including the host machine or even the internet.
- In most Docker setups, the default gateway for containers is “172.17.0.1”, which refers to the bridge network created by Docker.
- Think of the gateway as the router for the container — it helps route traffic from the container to external resources.
- When the container sends a request outside of its local network, the gateway acts as the intermediary, forwarding that request.
- IPAddress - The IP address is the unique identifier assigned to each container within a specific Docker network.
- This address allows the container to communicate with other containers in the same network.
- NetworkID - The NetworkID is a unique identifier that represents the network to which the container is connected.
- Docker automatically assigns this long string of characters as a network ID to distinguish between different networks.
docker/networking/inspect_a_network.txt · Last modified: 2025/07/25 19:38 by peter