docker network create -d bridge --subnet 172.20.0.0/16 --gateway 172.20.0.1 mynet

Category: Docker

docker network create -d bridge --subnet 172.20.0.0/16 --gateway 172.20.0.1 mynet

Create a bridge network with a custom subnet

Creates a bridge (default container-to-container) network on a private subnet with its gateway at 172.20.0.1. -d selects the driver; bridge is the default. Custom subnets avoid clashes with other networks.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.