[![Build Status](https://travis-ci.org/appc/cni.svg?branch=master)](https://travis-ci.org/appc/cni) [![Coverage Status](https://coveralls.io/repos/github/appc/cni/badge.svg?branch=master)](https://coveralls.io/github/appc/cni?branch=master) # CNI - the Container Network Interface ## What is CNI? CNI, the _Container Network Interface_, is a project to help configure network interfaces for Linux application containers. CNI concerns itself with setting up network connectivity of containers and removing allocated resources when the container is deleted. Because of this focus CNI has a wide range of support and the specification is simple to implement. The project repository contains a [simple specification](SPEC.md) for how executable plugins can be used to configure network namespaces, and a number of plugins, libraries and utilities written in Go that can be used to get started with CNI. The specification and the plugin architecture form a template system with perfectly clear interfaces. This allows developers to integrate their existing container networking solutions with a thin CNI wrapper plugin. It also gives a good framework to create new container networking solutions from scratch. ## Why develop CNI? Application containers on Linux are a rapidly evolving area, and within this space networking is a particularly unsolved problem, as it is highly environment-specific. We believe that every container runtime will seek to solve the same problem of making the network layer pluggable. To avoid duplication, we think it is prudent to define a common interface between the network plugins and container execution. Hence we are proposing this specification, along with an initial set of plugins that can be used by different container runtime systems. ## Who is using CNI? - [rkt - container engine](https://coreos.com/blog/rkt-cni-networking.html) - [Kurma - container runtime](http://kurma.io/) - [Kubernetes - a system to simplify container operations](http://kubernetes.io/docs/admin/network-plugins/) - [Cloud Foundry - a platform for cloud applications](https://github.com/cloudfoundry-incubator/guardian-cni-adapter) - [Weave - a multi-host Docker network](https://github.com/weaveworks/weave) - [Project Calico - a layer 3 virtual network](https://github.com/projectcalico/calico-cni) ## Contributing to CNI We welcome contributions, including [bug reports](https://github.com/appc/cni/issues), and code and documentation improvements. If you intend to contribute to code or documentation, please read [CONTRIBUTING.md](CONTRIBUTING.md). Also see the [contact section](#contact) in this README. ## How do I use CNI? ### Requirements CNI requires Go 1.5+ to build. Go 1.5 users will need to set GO15VENDOREXPERIMENT=1 to get vendored dependencies. This flag is set by default in 1.6. ### Included Plugins This repository includes a number of common plugins in the `plugins/` directory. Please see the [Documentation/](Documentation/) directory for documentation about particular plugins. ### Running the plugins The scripts/ directory contains two scripts, `priv-net-run.sh` and `docker-run.sh`, that can be used to exercise the plugins. **note - priv-net-run.sh depends on `jq`** Start out by creating a netconf file to describe a network: ```bash $ mkdir -p /etc/cni/net.d $ cat >/etc/cni/net.d/10-mynet.conf </etc/cni/net.d/99-loopback.conf <