参考:https://docs.docker.com/engine/reference/commandline/network_create/
列出所有的 network
docker network list
删除一个 network
docker network rm network-name
创建一个 network 并指定其 mtu
docker network create -o "com.docker.network.driver.mtu"=1450 network-name
注:有些虚拟机的 MTU 是1450,但是 docker 的默认 MUT 是 1500。
指定网段
docker network create --subnet='172.22.0.0/16' network-name
help 信息
官方文档:https://docs.docker.com/engine/reference/commandline/network_create/
docker network create --help
Usage: docker network create [OPTIONS] NETWORK
Create a network
Options:
--attachable Enable manual container attachment
--aux-address map Auxiliary IPv4 or IPv6 addresses used by Network driver (default map[])
--config-from string The network from which to copy the configuration
--config-only Create a configuration only network
-d, --driver string Driver to manage the Network (default "bridge")
--gateway strings IPv4 or IPv6 Gateway for the master subnet
--ingress Create swarm routing-mesh network
--internal Restrict external access to the network
--ip-range strings Allocate container ip from a sub-range
--ipam-driver string IP Address Management Driver (default "default")
--ipam-opt map Set IPAM driver specific options (default map[])
--ipv6 Enable IPv6 networking
--label list Set metadata on a network
-o, --opt map Set driver specific options (default map[])
--scope string Control the network's scope
--subnet strings Subnet in CIDR format that represents a network segment