Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netclient keeps added routes after disconnected #351

Open
imightbelosthere opened this issue Apr 17, 2023 · 2 comments
Open

Netclient keeps added routes after disconnected #351

imightbelosthere opened this issue Apr 17, 2023 · 2 comments

Comments

@imightbelosthere
Copy link

netclient v0.18.6 installed with service running and everything properly configured as far as I can see, however the Egress node routes published upon connection established do not get removed after disconnection.
This causes the machine to lose connectivity to the IP ranges published by the Egress node when the netclient is not connected.

@lexermal
Copy link

lexermal commented Sep 10, 2023

netclient 0.21.0 behaves the same way.
It's a pain. I try to connect to some hosts in the same local area network but can't because Netmaker only works with hosts with a different public IP. So I need to write a script for always leaving the Netmaker network and deleting all host entries when I'm in my home network where my server is located.

Please fix that or make Netmaker work over local area networks.

@lexermal
Copy link

I found a solution. You simply need to create a bridge over the Netmaker server. When I want to access a host in my network over the DNS name like I would by being connected to a network from Netmaker I use the DNS server from Netmaker as local DNS server and connect to Netmaker via Wireguard.

This is how I did it:

  1. Setup Netmaker on a VPS.
  2. Add a network.
  3. Create an access token for that network and copy it
  4. Add the following to the docker-compose.yml file and add the token:
  netclient:
    container_name: netclient-dns-server
    image: 'gravitl/netclient:v0.21.0'
    network_mode: "service:coredns"
    depends_on:
      - coredns
    restart: always
    privileged: true
    environment:
      TOKEN: my-token
    volumes:
      - ./netclient-data:/etc/netclient
  1. Start up the server again.
  2. Now a new host with a cryptic name joined the network. Rename it to a fitting name and copy its IP.
  3. Create a gateway in Netmaker in that network and set the default DNS server to the copied IP.
  4. Connect a device via Wireguard.

Now you can access all hosts in that network over the DNS name like you would with Netclient if you were behind another NAT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants