How to use / enable wireguard host peer? #308

Closed
opened 2025-11-20 05:09:24 -05:00 by saavagebueno · 3 comments
Owner

Originally created by @MohammedNoureldin on GitHub (Apr 5, 2023).

Hi,

My netbird self-hosted server is already part of my destination network, which I want my Netbird peers to be able to reach (I have a K8s cluster, and Netbird is already part of it. I want the clients to be able to reach the K8s network).

At the moment, the only solution to get it working is to create a "redundant" peer that is also part of the K8s network and route to it. It is somehow possible to enable wireguard-server peer interface in Netbird to be able to reach the network behind it without any additional Linux peer?

Originally created by @MohammedNoureldin on GitHub (Apr 5, 2023). Hi, My netbird self-hosted server is already part of my destination network, which I want my Netbird peers to be able to reach (I have a K8s cluster, and Netbird is already part of it. I want the clients to be able to reach the K8s network). At the moment, the only solution to get it working is to create a "redundant" peer that is also part of the K8s network and route to it. It is somehow possible to enable wireguard-server peer interface in Netbird to be able to reach the network behind it without any additional Linux peer?
Author
Owner

@aciidic commented on GitHub (Apr 26, 2023):

I resolved this buy running netbird client in another docker container on the same server

I'm new to docker (and netbird, and wireguard, and all of this) but this seemed to work for me....:

  1. Issue a setup key on netbird dashboard for your peer, I auto-assigned it to "Peers" group (clients have their own setup key and group)

  2. Create required access control groups between peers<>peers and clients<>clients if you want them to be able to communicate directly.

  3. Make a backup copy of /netbird/infrastructure_files/docker-compose.yml.tmpl

  4. Edit /netbird/infrastructure_files/docker-compose.yml.tmpl to add a new container for your peer/client:

  # Netbird Client Peer
  client:
    container_name: client
    hostname: CLIENT-PEER1
    image: netbirdio/netbird:latest
    restart: unless-stopped
    volumes:
      - netbird-client:/etc/netbird
    environment:
      - NB_SETUP_KEY=<YOUR_KEY>
    command: [
      "--management-url", "<MGMT_URL>:33073",
      "--log-file", "console"
      ]
    cap_add:
      - NET_ADMIN
    depends_on:
      - management
  1. Add client volume to volumes at bottom of docker-compose template:
volumes:
  netbird-client:

  1. Create client network bridge for client <> netbird at bottom of docker-compose template:
networks:
  netbird-network-bridge:
    driver: bridge
  1. Edit config of each service for management & signal & dashboard by linking the client network
management:
    networks:
      - netbird-network-bridge

dashboard:
    networks:
      - netbird-network-bridge

signal:
    networks:
      - netbird-network-bridge
  1. Run
cd /netbird/infrastructure_files
./configure.sh
docker-compose up -d
  1. Confirm client logs are ok with
    docker logs client

  2. Add the required network route using your new client as peer.

No guarantees;

  • I don't know if this is how it should be done
  • I don't know if it's best practice
  • I don't know if any or all of the above steps are required
  • I don't know if any of this will persist if you update netbird
@aciidic commented on GitHub (Apr 26, 2023): I resolved this buy running netbird client in another docker container on the same server I'm new to docker (and netbird, and wireguard, and all of this) but this seemed to work for me....: 1. Issue a [setup key](https://netbird.io/docs/overview/setup-keys) on netbird dashboard for your peer, I auto-assigned it to "Peers" group (clients have their own setup key and group) 2. Create required [access control](https://netbird.io/docs/overview/acls) groups between peers<>peers and clients<>clients if you want them to be able to communicate directly. 3. Make a backup copy of `/netbird/infrastructure_files/docker-compose.yml.tmpl` 4. Edit `/netbird/infrastructure_files/docker-compose.yml.tmpl` to add a new container for your peer/client: ``` # Netbird Client Peer client: container_name: client hostname: CLIENT-PEER1 image: netbirdio/netbird:latest restart: unless-stopped volumes: - netbird-client:/etc/netbird environment: - NB_SETUP_KEY=<YOUR_KEY> command: [ "--management-url", "<MGMT_URL>:33073", "--log-file", "console" ] cap_add: - NET_ADMIN depends_on: - management ``` 5. Add client volume to volumes at bottom of docker-compose template: ``` volumes: netbird-client: ``` 6. Create client network bridge for client <> netbird at bottom of docker-compose template: ``` networks: netbird-network-bridge: driver: bridge ``` 7. Edit config of each service for management & signal & dashboard by linking the client network ``` management: networks: - netbird-network-bridge dashboard: networks: - netbird-network-bridge signal: networks: - netbird-network-bridge ``` 8. Run ``` cd /netbird/infrastructure_files ./configure.sh docker-compose up -d ``` 9. Confirm client logs are ok with `docker logs client` 10. Add the required [network route ](https://netbird.io/docs/how-to-guides/network-routes) using your new client as peer. No guarantees; - I don't know if this is how it **should** be done - I don't know if it's best practice - I don't know if any or all of the above steps are required - I don't know if any of this will persist if you update netbird
Author
Owner

@MohammedNoureldin commented on GitHub (Apr 26, 2023):

Hi @aciidic, I also got it working in a similar way. I just wanted to avoid creating an additional client which is redundant IMO, because WireGuard offers a host peer out of the box. Anyway, apparently it works only this way at the moment.

@MohammedNoureldin commented on GitHub (Apr 26, 2023): Hi @aciidic, I also got it working in a similar way. I just wanted to avoid creating an additional client which is redundant IMO, because WireGuard offers a host peer out of the box. Anyway, apparently it works only this way at the moment.
Author
Owner

@MohammedNoureldin commented on GitHub (Nov 19, 2023):

Well, to keep the backlog clean. I will close this as this is not an issue, but kind of minor limitation that can solved by a workaround.

@MohammedNoureldin commented on GitHub (Nov 19, 2023): Well, to keep the backlog clean. I will close this as this is not an issue, but kind of minor limitation that can solved by a workaround.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#308