Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/pages/how-to/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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=<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
```

<Note>
`--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.
</Note>

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).