v0.4.0
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE1MTdYA1m9lqO/FEeGPNoXAAiv/MFAlqlTA0ACgkQGPNoXAAi
v/O76g//d2TvnBxA6S2Y5mxQeVha6acezhznCfX+wHjhj7fFRbZgugMNVTnCvRfM
nSXuq0RO3S3Dmbh6MovE6LbXlsaU6XdYq7MbiDusH1pl0V8u+kvL8zDskiPUf9Hx
9f/1ZrBcHEQFM+3W20L/fpCpRu0G74eRFUw0BcP/ebeThE5vF8xchbtL9++jEDZx
JQiPGyZVrlnc11arjleEZ6w2/YZ6xSUGKIQD9etwllLUaXvHjdXW1L6wxe5HZSZ9
9v3ULmynxWmDfhkFNj0Mg24ygDuQhgizVXg3dRRB3cEpLVgnuJVmx4eU/b3C65up
0nX5lfppMGQ6Z+X8IcEwqJz/J6gYMbOvZbIt30jcBBEbFzfG1PF1qwr+02Xd9m3+
gWMJfNQhntgOpwM7RV6VCdJ007tAuo8Bkrkt5+3knyQeS2HAs6+QnUGUOgIOmRsp
m/8I5RafJFVvYS5VfHF96o6YREq6/2XjSqwjcV/msJ+ma4NzwciA0pqInVBthfD8
gMpBezxPW7y0b16iRm/ZRBRZEXEZK3NYrGOenp0KUrr+NAGEoVKzOjNvkUduAUuW
yuN+YGn7muRU3j49YTj/n511/B+KmbMaY75IEqmsFU0jezdUAjO+rVR8K9mOzj4D
oT5BQ11LSz8XyK7eDbfM/jCjWYOcM0mMRi/cV68+irEDD0A8Dik=
=k5Oo
-----END PGP SIGNATURE-----
Bump version to v0.4.0

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2 files changed
tree: b0408320ab691864811ca8f7d26abf2a7d18cff5
  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.go
  11. interface.go
  12. ipallocator/
  13. list.go
  14. main.go
  15. vendor/
  16. 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.0

 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