v0.4.2
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE1MTdYA1m9lqO/FEeGPNoXAAiv/MFAltKH5wACgkQGPNoXAAi
v/PddQ//SX9A5hDBMgBS74/PenC3WbybOs6YPPcw8fAA9FdZbOpUi8714dkJ3BD/
s7ipd4zctbgzd4yizqUlkgumqVw3n8F3aldhUrenzJcrVwz7YJpeBbZzmgH19U/I
YbdDlrbE8NIa6yPuPvLvQ7+WQSLutz/MQn88Qv7uQ9dgVOh55/THBuTcBbN+ktHA
BZvVIJ1uqMQO6J13hJ77+bcina9a/u7UeQSm7J4XzwfgMux/T2guEBdEtjFf0zDc
nscBvkmFqVrsMBxqw6ulYLX030b6oG1aJQyvi7ZJ1+elXTFPoYsBbgJhbxDE/DYs
drsdmc+lHflhwetr3JsmRy5vlImfaE3Kxb0xzqkMPDYBygdY/V8h7RCyBhlMeVWY
wDJViludukFTc7M9r0bfEN7hsjSUQWr314RcSZWaMfWTfz9coSsp4b8t0Y7G7z3N
mLWE51s8pMRpPJ7YS1On/V6PWAmIyo2HRuhI21oTm35HChXs68YNmab+MR8qniyP
N7a5wrjNJkyZmNnYll8np//bhW23np4ShKomShspT9dACPtvgCrQA5XV3YzCmgj+
y9eItW/hOlUI4KyVNIcbTu/YLBcF1fOPx2vHeJn6Fxraq+uumn324mkvbCLYzB/W
cHUgTluFNJrYvq9327kFEEu2vkOw9PdvvTAOVca+5yXYU1c4GS0=
=rQ7Z
-----END PGP SIGNATURE-----
Bump version to v0.4.2

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2 files changed
tree: 904ad361020600db6237375d84a5cfc9bf7a7338
  1. .gitignore
  2. .travis.yml
  3. Dockerfile
  4. Gopkg.lock
  5. Gopkg.toml
  6. LICENSE
  7. Makefile
  8. README.md
  9. VERSION.txt
  10. bridge/
  11. main.go
  12. netutils/
  13. network/
  14. vendor/
  15. version/
README.md

netns

Travis CI

Runc hook for setting up default bridge networking.

Installation

Binaries

Via Go

$ go get github.com/genuinetools/netns

Usage

$ netns --help
            _
 _ __   ___| |_ _ __  ___
| '_ \ / _ \ __| '_ \/ __|
| | | |  __/ |_| | | \__ \
|_| |_|\___|\__|_| |_|___/

 Runc hook for setting up default bridge networking.
 Version: v0.4.2

 Netns provides the following commands. Usage format:

    netns [-flag value] [-flag value] command

  Where command is one of:

    createbr, delbr, [ls|list], delete

  If command is blank (e.g. when called via a hook) it
  will create a network endpoint in the expected net
  namespace details for that PID.

  -bridge string
        name for bridge (default "netns0")
  -d    run in debug mode
  -iface string
        name of interface in the namespace (default "eth0")
  -ip string
        ip address for bridge (default "172.19.0.1/16")
  -ipfile string
        file in which to save the containers ip address (default ".ip")
  -mtu int
        mtu for bridge (default 1500)
  -state-dir string
        directory for saving state, used for ip allocation (default "/run/github.com/genuinetools/netns")
  -v    print version and exit (shorthand)
  -version
        print version and exit

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