Manage Docker networks beyond the basics. In this guide, you’ll learn how to list default networks, inspect their settings, connect or disconnect containers, and remove unused networks to keep your Docker environment clean.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Table of Contents
- Listing Default Networks
- Inspecting a Network
- Connecting and Disconnecting Containers
- Removing Networks
Listing Default Networks
Docker provides three built-in networks out of the box:bridge, host, and none. Use the following command to see them:
| Network Name | Driver | Scope | Description |
|---|---|---|---|
| bridge | bridge | local | Default network for standalone containers |
| host | host | local | Containers share the host’s network namespace |
| none | null | local | Containers have no network interfaces |
The bridge network uses the
172.17.0.0/16 subnet by default, with gateway 172.17.0.1 assigned to the docker0 interface on the host.Inspecting a Network
To dive deeper into a network’s configuration—such as its IPAM settings, subnets, gateways, and attached containers—run:Connecting and Disconnecting Containers
You can attach a running container to additional networks or remove it from one without restarting:Removing Networks
Clean up unused networks to avoid clutter:This will remove all networks not used by at least one container.
Are you sure you want to continue? [y/N]
Are you sure you want to continue? [y/N]