0

I'm trying to understand the networking model in CoreOS but I'm having trouble making the operating system bend to my will.

The problem I'm facing is that I want to use weave as an overlay network inside containers, to facilitate an IP+Port tuple, unique-per-service.

However, when testing CoreOS on my laptop with vagrant and virtualbox, I'm having trouble making CoreOS accept that the docker daemon should use a different cidr than 10.1.0.0/16. This despite having done:

cp /usr/lib/systemd/system/docker.service /etc/systemd/system/
vim /etc/systemd/system/docker.service

and having this in user-data:

  3   units:
  2     - name: docker.service
  1       command: restart
  0       content: |
  1         [Unit]
  2         Description=Docker Application Container Engine
  3         Documentation=http://docs.docker.com
  4         After=docker.socket early-docker.target network.target
  5         Requires=docker.socket early-docker.target
  6
  7         [Service]
  8         Environment=TMPDIR=/var/tmp
  9         EnvironmentFile=-/run/flannel_docker_opts.env
 10         MountFlags=slave
 11         LimitNOFILE=1048576
 12         LimitNPROC=1048576
 13         ExecStart=/usr/lib/coreos/dockerd --daemon --host=fd:// --icc=false --fixed-cidr=172.17.42.0/16 $DOCKER_OPTS $    DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ
 14
 15         [Install]
 16         WantedBy=multi-user.target
 17

I've restarted the machine, restarted docker and now I can't start because it tells me:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Fri 2015-03-06 08:53:40 UTC; 13s ago
     Docs: http://docs.docker.com
  Process: 2331 ExecStart=/usr/lib/coreos/dockerd --daemon --host=fd:// --bridge=docker0 --icc=false --fixed-cidr=172.17.42.0/16 $DOCKER_OPTS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ (code=exited, status=1/FAILURE)
 Main PID: 2331 (code=exited, status=1/FAILURE)

Mar 06 08:53:40 core-01 dockerd[2331]: network does not contain specified subnet
Mar 06 08:53:40 core-01 dockerd[2331]: time="2015-03-06T08:53:40Z" level="info" msg="-job init_networkdriver() = ERR (1)"
Mar 06 08:53:40 core-01 dockerd[2331]: time="2015-03-06T08:53:40Z" level="fatal" msg="network does not contain specified subnet"
Mar 06 08:53:40 core-01 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Mar 06 08:53:40 core-01 systemd[1]: Unit docker.service entered failed state.
Mar 06 08:53:40 core-01 systemd[1]: docker.service failed.
Mar 06 08:53:40 core-01 systemd[1]: Starting Docker Application Container Engine...
Mar 06 08:53:40 core-01 systemd[1]: start request repeated too quickly for docker.service
Mar 06 08:53:40 core-01 systemd[1]: Failed to start Docker Application Container Engine.
Mar 06 08:53:40 core-01 systemd[1]: docker.service failed.

Why is this?

Here's the docker0 interface:

4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 56:84:7a:fe:97:99 brd ff:ff:ff:ff:ff:ff
    inet 172.17.42.1/16 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::5484:7aff:fefe:9799/64 scope link
       valid_lft forever preferred_lft forever
0

It's looking for a blip, or rather a --bip=172.17.42.1/16 configuration setting, instead of fixed cidr.

You'll also have to manually tear down the bridge interface:

                 ip link set dev docker0 down
core-01 system # brctl delbr docker0
core-01 system # systemctl daemon-reload
core-01 system # systemctl start docker
core-01 system # journalctl -fu docker.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.