mirror of
https://codeberg.org/icewind/netnsd.git
synced 2026-06-03 17:14:06 +02:00
document config
This commit is contained in:
parent
ca5b60a9b9
commit
1964551e9d
2 changed files with 66 additions and 2 deletions
40
README.md
40
README.md
|
|
@ -16,7 +16,7 @@ A declarative manager for Linux network namespaces.
|
||||||
netnsd daemon [--config <config.toml>]
|
netnsd daemon [--config <config.toml>]
|
||||||
```
|
```
|
||||||
|
|
||||||
Start the netnsd daemon, applying the configured namespace configuration and
|
Start the `netnsd` daemon, applying the configured namespace configuration and
|
||||||
running any proxies.
|
running any proxies.
|
||||||
|
|
||||||
You can tell the daemon to reload the configuration with `pkill -sighup netnsd`.
|
You can tell the daemon to reload the configuration with `pkill -sighup netnsd`.
|
||||||
|
|
@ -38,4 +38,40 @@ Applying the configured namespace and exit.
|
||||||
netnsd down
|
netnsd down
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove all namespaces created by netnsd and exit.
|
Remove all namespaces created by `netnsd` and exit.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
By default `netnsd` will look for it's configuration in `/etc/netnsd/netnsd`.
|
||||||
|
You can specify a different configuration path with the `--config` option.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# You can define any number of namespaces to create
|
||||||
|
[[namespace]]
|
||||||
|
# name of the namespace to create
|
||||||
|
name = "test"
|
||||||
|
|
||||||
|
# You can define any number of port forwards to setup into the namespace
|
||||||
|
[[namespace.forward]]
|
||||||
|
# port, address or socket outside the namespace to listen on
|
||||||
|
# when only a port is specified it will listen on 0.0.0.0
|
||||||
|
source = 8091
|
||||||
|
# port or address inside the namespace to forward to
|
||||||
|
# when only a port is specified it will forward to 127.0.0.1
|
||||||
|
target = 80
|
||||||
|
|
||||||
|
[[namespace.forward]]
|
||||||
|
# listening on a unix socket instead of a tcp port
|
||||||
|
source = "/run/test/https"
|
||||||
|
# forward to a specific address instead of 127.0.0.1
|
||||||
|
target = "127.0.0.2:443"
|
||||||
|
|
||||||
|
# Another namespace
|
||||||
|
[[namespace]]
|
||||||
|
name = "test2"
|
||||||
|
|
||||||
|
[[namespace.forward]]
|
||||||
|
# listening on a specific address instead of 0.0.0.0
|
||||||
|
source = "127.0.0.1:9091"
|
||||||
|
target = 80
|
||||||
|
```
|
||||||
|
|
|
||||||
28
config.sample.toml
Normal file
28
config.sample.toml
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
# You can define any number of namespaces to create
|
||||||
|
[[namespace]]
|
||||||
|
# name of the namespace to create
|
||||||
|
name = "test"
|
||||||
|
|
||||||
|
# You can define any number of port forwards to setup into the namespace
|
||||||
|
[[namespace.forward]]
|
||||||
|
# port, address or socket outside the namespace to listen on
|
||||||
|
# when only a port is specified it will listen on 0.0.0.0
|
||||||
|
source = 8091
|
||||||
|
# port or address inside the namespace to forward to
|
||||||
|
# when only a port is specified it will forward to 127.0.0.1
|
||||||
|
target = 80
|
||||||
|
|
||||||
|
[[namespace.forward]]
|
||||||
|
# listening on a unix socket instead of a tcp port
|
||||||
|
source = "/run/test/https"
|
||||||
|
# forward to a specific address instead of 127.0.0.1
|
||||||
|
target = "127.0.0.2:443"
|
||||||
|
|
||||||
|
# Another namespace
|
||||||
|
[[namespace]]
|
||||||
|
name = "test2"
|
||||||
|
|
||||||
|
[[namespace.forward]]
|
||||||
|
# listening on a specific address instead of 0.0.0.0
|
||||||
|
source = "127.0.0.1:9091"
|
||||||
|
target = 80
|
||||||
Loading…
Add table
Add a link
Reference in a new issue