flannel error failed to initialize network failed to open tun device

I’m using flannel for the first time and I’m testing it with two nodes (Ubuntu14.04) with etcd running. The ip addresses of the two nodes are (node1) and (node2), and they can ping each other without problem. I have configured flannel network in etcd as follows:
On node1: etcdctl set /coreos.com/network/config '{ "Network": "" }'
On node2: etcdctl set /coreos.com/network/config '{ "Network": "" }'
However, whenever I run flanneld on either node I get the following error:

E0523 14:11:29.325240 28803 network.go:71] Failed to initialize network (type UDP): Failed to open TUN device: ioctl failed with ‘operation not permitted’

  • Docker service Limits and Reservations
  • How to circumvent “Read-only file system” error on Docker version 0.11 or greater when running sysctl -w during an image build?
  • How to manage Docker private registry
  • Docker compose version 2.1+ on mac
  • In Docker, do I need to publish ports if I set network to host?
  • LDAP authentication in Docker container
  • Is there any clue on solving this problem?

  • How to fix server error while pushing an image to the Docker hub?
  • sonatype nexus docker volume error
  • Current Docker approach with respect to Ambassador pattern
  • Can not connect from golang to docker postgres container
  • Why does enablePlugins(DockerPlugin) from sbt-docker in Play project give “error: reference to DockerPlugin is ambiguous”?
  • R - install.packages not working in docker on coreos on compute engine
  • One Solution collect form web for “flannel error failed to initialize network failed to open tun device”

    It turned out to be a permission issue. Simply sudo flanneld will work.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.