
The command for this would be:ĭocker network create -driver=bridge -subnet=192.168.2.0/24 -gateway=192.168.2.10 new_subnet Let’s say you want to create a network with a subnet of 192.168.2.0/24, a gateway of 192.168.2.10, and the name new_subnet. Run the inspect command on that newly created network with the command docker network inspect isolated to see that our new network has been automatically given its own subnet and gateway ( Figure D).īut what if you want to create a network with a specific subnet and gateway? That’s possible as well. The output of that command will be a long string of characters that represents the ID of that newly-created network ( Figure C). The creation of this network can be achieved with a single command:ĭocker network create -driver bridge isolated
#Docker network create default subnet how to
I’m going to demonstrate how to create a bridge network and then show you how to deploy a container on that network. The output of that command would give you all the information you need about that network ( Figure B). If you want to view details on the bridge network, that command would be docker network inspect bridge.

You can get more information on a particular network, by issuing the command docker network inspect NAME (Where NAME is the name of the network you want to view). The above command will list out the Docker networks ( Figure A). To view the current list of Docker networks, issue the command: Let’s see how we can manage those networks, create a new network, and then deploy a container on our new network.

Did you know you can actually create networks that offer complete isolation for Docker and then deploy containers on those isolated networks? Of course, the more you learn about Docker, the more you realize there is to learn about Docker. Once up to speed on the platform, there’s very little you can’t do. Here's how to make use of this highly flexible feature.ĭocker is one of the most flexible and user-friendly container systems on the market. On August 24, 2017, 8:38 AM PDT How to create and manage Docker networksĭocker allows you to create specific networks and attach containers to them.
