gravitl / netmaker

Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
https://netmaker.io
Other
9.5k stars 552 forks source link

netmaker (server) w/ CLIENT_MODE on doesn't update routes node joins/deletes #657

Closed ygelfand closed 2 years ago

ygelfand commented 2 years ago

wg output:

...
interface: nm-foo

public key: kOO.....
  private key: (hidden)
  listening port: 31821

peer: 6VX....
  allowed ips: 10.70.0.9/32
  persistent keepalive: every 20 seconds

peer: ljz2...
  allowed ips: 10.70.0.12/32
  persistent keepalive: every 20 seconds

while routing tables shows

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         169.254.1.1     0.0.0.0         UG    0      0        0 eth0
10.70.0.9       0.0.0.0         255.255.255.255 UH    0      0        0 nm-foo
10.70.0.14      0.0.0.0         255.255.255.255 UH    0      0        0 nm-foo
169.254.1.1     0.0.0.0         255.255.255.255 UH    0      0        0 eth0

in this case, 10.70.0.14 was removed, and a new node 10.70.0.12 joined.

upon restart, wg shows the same, while routing table correctly shows

10.70.0.9       0.0.0.0         255.255.255.255 UH    0      0        0 nm-foo
10.70.0.12      0.0.0.0         255.255.255.255 UH    0      0        0 nm-foo

This is running within a kubernetes cluster, w/ userspace wireguard-go, and using the gravitl/netmaker:v0.9.4-kube image, if that makes a difference.

afeiszli commented 2 years ago

Routes have been refactored in v0.11.0, so this should no longer be an issue in the newer version.