I use a docker swarm 1.13.1, and when I init the docker swarm or join to docker swarm sometimes it creates a docker_gwbridge network in a "172.19.0.0/16" subnet.
But my computer subnet is in the same range, so when it initializes this network the docker swarm host machine becomes inaccessible from my computer.
So my question is: how can I change the subnet of the existing docker network.
> docker network ls
NETWORK ID NAME DRIVER SCOPE
ac1100164960 bridge bridge local
3838ae360f35 docker_gwbridge bridge local
f9a77266aa15 host host local
rgqnm19zbasv ingress overlay swarm
04c1c6b3ade7 none null local
Inspect the network:
> docker network inspect 3838ae360f35
[
{
"Name": "docker_gwbridge",
"Id": "3838ae360f3585f2cda8a43a939643cdd74c0db9bfb7f4f18b3b80ae07b3b9db",
"Created": "2017-03-22T13:26:50.352865644+01:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.19.0.0/16",
"Gateway": "172.19.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Containers": {
"ingress-sbox": {
"Name": "gateway_ingress-sbox",
"EndpointID": "194d965dd2997bddb52eab636950e219043215a5a1a6a60d08f34e454a0eaa56",
"MacAddress": "02:42:ac:13:00:02",
"IPv4Address": "172.19.0.2/16",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.enable_icc": "false",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.name": "docker_gwbridge"
},
"Labels": {}
}
]
docker network create --subnet={Your prefered subnet } -o com.docker.network.bridge.enable_icc=false -o com.docker.network.bridge.name=docker_gwbridge docker_gwbridge
– Blackness