Runc hook (OCI compatible) for setting up default bridge networking for containers.
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bridge cleanup Jun 8, 2018
netutils cleanup a bit Jun 8, 2018
network update Sep 25, 2018
vendor update vendor Sep 25, 2018
version update version Jun 7, 2017
.gitignore update makefile Sep 25, 2018
.goosarch update generated project files Jul 16, 2018
.travis.yml Fix golint import path (#10) Oct 22, 2018
.traviskey update generated project files Jul 16, 2018
Dockerfile update Sep 25, 2018
LICENSE update generated project files Mar 11, 2018
Makefile update makefile Sep 25, 2018
README.md Bump version to v0.5.0 Jul 16, 2018
VERSION.txt Bump version to v0.5.2 Sep 25, 2018
basic.mk update Sep 25, 2018
create.go Bump version to v0.5.0 Jul 16, 2018
go.mod update vendor Sep 25, 2018
go.sum update vendor Sep 25, 2018
list.go Bump version to v0.5.0 Jul 16, 2018
main.go Bump version to v0.5.0 Jul 16, 2018
remove.go Bump version to v0.5.0 Jul 16, 2018

README.md

netns

Travis CI GoDoc Github All Releases

Runc hook for setting up default bridge networking.

Installation

Binaries

For installation instructions from binaries please visit the Releases Page.

Via Go

$ go get github.com/genuinetools/netns

Usage

$ netns -h
netns -  Runc hook for setting up default bridge networking.

Usage: netns <command>

Flags:

  --ipfile     file in which to save the containers ip address (default: .ip)
  --mtu        mtu for bridge (default: 1500)
  --state-dir  directory for saving state, used for ip allocation (default: /run/github.com/genuinetools/netns)
  --bridge     name for bridge (default: netns0)
  -d           enable debug logging (default: false)
  --iface      name of interface in the namespace (default: eth0)
  --ip         ip address for bridge (default: 172.19.0.1/16)

Commands:

  create   Create a network.
  ls       List networks.
  rm       Delete a network.
  version  Show the version information.

Place this in the Hooks.Prestart field of your runc config.

{
    ...
    "hooks": {
        "prestart": [
            {
                "path": "/path/to/netns"
            }
        ]
    },
    ...
}

List network namespaces

$ sudo netns ls
IP                  LOCAL VETH          PID                 STATUS
172.19.0.3          netnsv0-21635       21635               running
172.19.0.4          netnsv0-21835       21835               running
172.19.0.5          netnsv0-22094       22094               running
172.19.0.6          netnsv0-25996       25996               running