diff --git a/src/pages/how-to/examples.mdx b/src/pages/how-to/examples.mdx index 8f5eb95d..88d3b8cb 100644 --- a/src/pages/how-to/examples.mdx +++ b/src/pages/how-to/examples.mdx @@ -104,12 +104,22 @@ You would need to obtain a [setup key](/how-to/register-machines-using-setup-key The setup key could be found in the NetBird Management dashboard under the Setup Keys tab - [https://app.netbird.io/setup-keys](https://app.netbird.io/setup-keys). -Set the ```NB_SETUP_KEY``` environment variable and run the command. +Set the environment variables: + +- `PEER_NAME` - Peer's name and hostname as appearing in the Dashboard/DNS queries +- `NB_SETUP_KEY` +- `EXTERNAL_INTERFACE` - an external interface, the machine uses for Internet access + +and run the command: ```bash -docker run --rm --name PEER_NAME --hostname PEER_NAME --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --cap-add=SYS_RESOURCE -d -e NB_SETUP_KEY= -v netbird-client:/etc/netbird netbirdio/netbird:latest +docker run --rm -d --name "$PEER_NAME" --hostname "$PEER_NAME" --cap-add=NET_ADMIN --cap-add=NET_RAW --cap-add=CAP_BPF -e NB_SETUP_KEY="$NB_SETUP_KEY" -v netbird-client:"/etc/netbird" --sysctl "net.ipv4.conf.all.src_valid_mark=1" --sysctl "net.ipv4.conf.all.rp_filter=2" --sysctl "net.ipv4.conf.${EXTERNAL_INTERFACE}.rp_filter=2" netbirdio/netbird:latest ``` + + `--cap-add=CAP_BPF` was introduced with kernel version `5.8`, you might want to replace it with `--cap-add=CAP_SYS_ADMIN` when running older kernel. + + That is it! Enjoy using NetBird. If you would like to learn how to run NetBird Client as an ECS agent on AWS, please refer to [this guide](#net-bird-client-on-aws-ecs-terraform).