docker network create, what is the difference between --subnet and --ip-range

Viewed 379

The Docker Networking documentation states:

  • subnet : Subnet in CIDR format that represents a network segment
  • ip-range : Allocate container ip from a sub-range

And the example shows:

$ docker network create \
  --driver=bridge \
  --subnet=172.28.0.0/16 \
  --ip-range=172.28.5.0/24 \
  --gateway=172.28.5.254 \
  br0

So, the subnet is from 172.28.0.0 to 172.28.255.255

And the ip-range is from 172.28.5.0 to 172.28.5.255

Why would you make the subnet larger than the ip-range?

Why is there a subnet AND an ip-range option?

0 Answers
Related