gravitl / netmaker

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

[Bug]: IPv6 address not assigned in netmaker backend container #1070

Closed lorenzo95 closed 2 years ago

lorenzo95 commented 2 years ago

Contact Details

Lorenzo95 in discord

What happened?

When creating a new network in netmaker and assigning an ipv6 prefix, the auto-generated node IP is not assigned to the wireguard interface but somehow the ipv4 address is assigned twice. Once as /24 and once as /32.

image image

It works correctly on regular netcliend instances but somehow in the container it does not. The eth0 above shows an fe80 so I don't think it's an os issue. This is running with the platform kubernetes env flag.

I can manually assign a v6 address to the eth0 interface but not to any wg interfaces

bash-5.1# ip -6 addr add 2001:470:28:5b2::1/64 dev eth0      <-- works fine
bash-5.1# ip -6 addr add 2001:470:28:5b2::1/64 dev nm-ByteMe
RTNETLINK answers: Invalid argument

Version

v0.13.1

What OS are you using?

Linux

Relevant log output

kubectl -n netmaker logs netmaker-backend-7fc56f5d66-mp5bh netmaker-backend

    ______     ______     ______     __   __   __     ______   __
   /\  ___\   /\  == \   /\  __ \   /\ \ / /  /\ \   /\__  _\ /\ \
   \ \ \__ \  \ \  __<   \ \  __ \  \ \ \'/   \ \ \  \/_/\ \/ \ \ \____
    \ \_____\  \ \_\ \_\  \ \_\ \_\  \ \__|    \ \_\    \ \_\  \ \_____\
     \/_____/   \/_/ /_/   \/_/\/_/   \/_/      \/_/     \/_/   \/_____/

 __   __     ______     ______   __    __     ______     __  __     ______     ______
/\ "-.\ \   /\  ___\   /\__  _\ /\ "-./  \   /\  __ \   /\ \/ /    /\  ___\   /\  == \
\ \ \-.  \  \ \  __\   \/_/\ \/ \ \ \-./\ \  \ \  __ \  \ \  _"-.  \ \  __\   \ \  __<
 \ \_\\"\_\  \ \_____\    \ \_\  \ \_\ \ \_\  \ \_\ \_\  \ \_\ \_\  \ \_____\  \ \_\ \_\
  \/_/ \/_/   \/_____/     \/_/   \/_/  \/_/   \/_/\/_/   \/_/\/_/   \/_____/   \/_/ /_/

[netmaker] 2022-05-07 18:58:40 connecting to sqlite
[netmaker] 2022-05-07 18:58:40 database successfully connected
[netmaker] 2022-05-07 18:58:41 no OAuth provider found or not configured, continuing without OAuth
[netmaker] 2022-05-07 18:58:41 error running command: /sbin/ip address add dev nm-ByteMe 10.222.1.254/64
[netmaker] 2022-05-07 18:58:41 Error: any valid prefix is expected rather than "10.222.1.254/64".
[netmaker] 2022-05-07 18:58:41 error running command: /sbin/ip address add dev nm-ByteMe fd4a:809d:5535:b9b5:ffff:ffff:ffff:ffff/128
[netmaker] 2022-05-07 18:58:41 RTNETLINK answers: Invalid argument

Contributing guidelines

afeiszli commented 2 years ago

Fixed in 0.14.0.