Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/genuinetools/netns
Runc hook (OCI compatible) for setting up default bridge networking for containers.
https://github.com/genuinetools/netns
cli containers linux netns opencontainers runc runc-hook
Last synced: 3 months ago
JSON representation
Runc hook (OCI compatible) for setting up default bridge networking for containers.
- Host: GitHub
- URL: https://github.com/genuinetools/netns
- Owner: genuinetools
- License: mit
- Created: 2016-01-15T01:07:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-21T18:22:37.000Z (about 3 years ago)
- Last Synced: 2024-07-20T02:43:36.001Z (4 months ago)
- Topics: cli, containers, linux, netns, opencontainers, runc, runc-hook
- Language: Go
- Homepage:
- Size: 4.24 MB
- Stars: 222
- Watchers: 14
- Forks: 37
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# netns
[![make-all](https://github.com/genuinetools/netns/workflows/make%20all/badge.svg)](https://github.com/genuinetools/netns/actions?query=workflow%3A%22make+all%22)
[![make-image](https://github.com/genuinetools/netns/workflows/make%20image/badge.svg)](https://github.com/genuinetools/netns/actions?query=workflow%3A%22make+image%22)
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=for-the-badge)](https://godoc.org/github.com/genuinetools/netns)
[![Github All Releases](https://img.shields.io/github/downloads/genuinetools/netns/total.svg?style=for-the-badge)](https://github.com/genuinetools/netns/releases)Runc hook for setting up default bridge networking.
**Table of Contents**
- [Installation](#installation)
- [Binaries](#binaries)
- [Via Go](#via-go)
- [Usage](#usage)## Installation
#### Binaries
For installation instructions from binaries please visit the [Releases Page](https://github.com/genuinetools/netns/releases).
#### Via Go
```console
$ go get github.com/genuinetools/netns
```## Usage
```console
$ netns -h
netns - Runc hook for setting up default bridge networking.Usage: netns
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.
```json
{
...
"hooks": {
"prestart": [
{
"path": "/path/to/netns"
}
]
},
...
}
```**List network namespaces**
```console
$ 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
```