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

[Bug]: When connecting netclient to a second network an interface is not created #1282

Closed sahoahfoa closed 6 months ago

sahoahfoa commented 2 years ago

Contact Details

Discord: Scottie#8631

What happened?

When joining my Windows 11 netclient to a second network the wg interface is not created and does not appear in wg show. dlrow_olleh on discord suggested changing the default port setting or enabling UDP punching for the second network . This fixed the issue and the interface was created when pulling the config again (I might have had to leave and rejoin actually). I'm assuming wireguard sees the second network pointing at the same endpoint and port and wont create the second interface. According to dlrow_olleh "netclient should check if the port is in use and use a different one"

Version

v0.14.4

What OS are you using?

Windows

Relevant log output

PS C:\Program Files (x86)\Netclient> netclient pull -vvv -n sahnet
[netclient.exe] 2022-07-01 18:33:25 netclient.exe is in proper location, C:\Program Files (x86)\Netclient\netclient.exe
2022/07/01 18:33:25 Gravitl Netclient on Windows started
[netclient.exe] 2022-07-01 18:33:25 turn on UDP hole punching (dynamic port setting)? no
[netclient.exe] 2022-07-01 18:33:28 waiting for interface...
[netclient.exe] 2022-07-01 18:33:30 interface ready - netclient.. ENGAGE
[netclient.exe] 2022-07-01 18:33:34 pulled network config for sahnet
[netclient.exe] 2022-07-01 18:33:34 register at https://api.netmaker.redacted:443/api/server/register
[netclient.exe] 2022-07-01 18:33:34 certificates/key saved
[netclient.exe] 2022-07-01 18:33:35 running stop of Windows Netclient daemon
[netclient.exe] 2022-07-01 18:33:36 error running command: "C:\Program Files (x86)\Netclient\winsw.exe" "stop"
[netclient.exe] 2022-07-01 18:33:36 '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
 perable program or batch file.
[netclient.exe] 2022-07-01 18:33:36 error with stop of Windows Netclient daemon: exit status 1 : '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
operable program or batch file.

[netclient.exe] 2022-07-01 18:33:36 running start of Windows Netclient daemon
[netclient.exe] 2022-07-01 18:33:36 error running command: "C:\Program Files (x86)\Netclient\winsw.exe" "start"
[netclient.exe] 2022-07-01 18:33:36 '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
 perable program or batch file.
[netclient.exe] 2022-07-01 18:33:36 error with start of Windows Netclient daemon: exit status 1 : '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
operable program or batch file.

[netclient.exe] 2022-07-01 18:33:36 reset network and peer configs

#####################################################################################################

netclient pull -vvv -n nocnet
[netclient.exe] 2022-07-01 18:32:01 netclient.exe is in proper location, C:\Program Files (x86)\Netclient\netclient.exe
2022/07/01 18:32:01 Gravitl Netclient on Windows started
[netclient.exe] 2022-07-01 18:32:01 turn on UDP hole punching (dynamic port setting)? no
[netclient.exe] 2022-07-01 18:32:04 waiting for interface...
file does not exist
[netclient.exe] 2022-07-01 18:32:06 Error pulling network config for network:  nocnet
 could not reliably create interface, please check wg installation and retry
[netclient.exe] 2022-07-01 18:32:06 register at https://api.netmaker.redacted:443/api/server/register
[netclient.exe] 2022-07-01 18:32:06 certificates/key saved
[netclient.exe] 2022-07-01 18:32:07 running stop of Windows Netclient daemon
[netclient.exe] 2022-07-01 18:32:07 error running command: "C:\Program Files (x86)\Netclient\winsw.exe" "stop"
[netclient.exe] 2022-07-01 18:32:07 '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
 perable program or batch file.
[netclient.exe] 2022-07-01 18:32:07 error with stop of Windows Netclient daemon: exit status 1 : '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
operable program or batch file.

[netclient.exe] 2022-07-01 18:32:07 running start of Windows Netclient daemon
[netclient.exe] 2022-07-01 18:32:07 error running command: "C:\Program Files (x86)\Netclient\winsw.exe" "start"
[netclient.exe] 2022-07-01 18:32:07 '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
 perable program or batch file.
[netclient.exe] 2022-07-01 18:32:07 error with start of Windows Netclient daemon: exit status 1 : '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
operable program or batch file.

[netclient.exe] 2022-07-01 18:32:07 reset network and peer configs

#####################################################################################################

PS C:\Program Files (x86)\Netclient> netclient leave -vvv -n nocnet
[netclient.exe] 2022-07-01 18:37:39 netclient.exe is in proper location, C:\Program Files (x86)\Netclient\netclient.exe
2022/07/01 18:37:39 Gravitl Netclient on Windows started
[netclient.exe] 2022-07-01 18:37:39 deleted node QuantumWave  on network  nocnet
[netclient.exe] 2022-07-01 18:37:39 could not flush peer routes when leaving network,  nocnet
[netclient.exe] 2022-07-01 18:37:39 removed WireGuard interface:  nm-nocnet
[netclient.exe] 2022-07-01 18:37:39 removed  nocnetnetwork locally
[netclient.exe] 2022-07-01 18:37:40 running stop of Windows Netclient daemon
[netclient.exe] 2022-07-01 18:37:40 error running command: "C:\Program Files (x86)\Netclient\winsw.exe" "stop"
[netclient.exe] 2022-07-01 18:37:40 '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
 perable program or batch file.
[netclient.exe] 2022-07-01 18:37:40 error with stop of Windows Netclient daemon: exit status 1 : '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command,
operable program or batch file.

[netclient.exe] 2022-07-01 18:37:40 success

#####################################################################################################

PS C:\Program Files (x86)\Netclient> netclient join -vvv -t <token>
[netclient.exe] 2022-07-01 18:38:26 netclient.exe is in proper location, C:\Program Files (x86)\Netclient\netclient.exe
2022/07/01 18:38:26 Gravitl Netclient on Windows started
[netclient.exe] 2022-07-01 18:38:26 joining nocnet at api.netmaker.redacted:443
[netclient.exe] 2022-07-01 18:38:26 node created on remote server...updating configs
[netclient.exe] 2022-07-01 18:38:26 starting wireguard
[netclient.exe] 2022-07-01 18:38:26 turn on UDP hole punching (dynamic port setting)? no
[netclient.exe] 2022-07-01 18:38:28 waiting for interface...
file does not exist
[netclient.exe] 2022-07-01 18:38:46 error installing:  could not reliably create interface, please check wg installation and retry
[netclient.exe] 2022-07-01 18:38:46 removed WireGuard interface:  nm-nocnet

Contributing guidelines

MatthewReed303 commented 2 years ago

I'm also getting these same errors using the windows netclient. I can establish a connection and it's then goes to warning and then error.

[netclient.exe] 2022-08-03 11:25:40 error with start of Windows Netclient daemon: exit status 1 : '"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command, operable program or batch file.

RyanWor commented 2 years ago

Also having this issue on Windows 11.

"C:\Program Files (x86)\Netclient\winsw.exe"' is not recognized as an internal or external command

Looking in that directory I do not see the winsw.exe file so the error makes sense. Not sure why it's not getting installed when doing the standard PowerShell install of netclient.

RyanWor commented 2 years ago

For what it's worth, I reinstalled netclient but using the msi based installer. (I did not uninstall the existing client first). That method did install winsw.exe as expected and running netclient pull afterwards is now working properly.

abhishek9686 commented 6 months ago

@sahoahfoa there have been lot of changes since v0.14.4, please try out the setup with latest version