gravitl / netmaker

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

[Bug]: Egress Gateway breaks internet access on reboot #1760

Closed charleswinsor closed 3 months ago

charleswinsor commented 1 year ago

Contact Details

charles.winsor@cognitiveadvantage.com.au

What happened?

We have a Ubuntu Server 22.04 node with two physical network interfaces: one connected to a LAN with internet access, the other connected to a LAN without internet access. I want to use this node as an Egress Gateway so other hosts on the LAN without internet access are addressable and accessible from within the mesh network.

The node works as expected when running Netclient. When the node is set as an Egress Gateway in Netmaker, it continues to work as expected until its next reboot (or manual sudo netclient pull command). After reboot, the node:

If we login to the node by its console, run a manual sudo netclient leave command, and reboot, then the node regains its internet access and is again reachable from the local LAN.

Version

v0.16.3

What OS are you using?

Linux

Relevant log output

## after running sudo netclient pull on Egress Gateway
setupMQTT(): unable to connect to broker, retrying ...
setupMQTT(): could not connect to broker [redacted] nslookup failed for broker ... check dns records
...
checkin(): error encountered checking public ip addresses:  public address not found
GetLocalListenPort(): failed to parse interface nm-[redacted]
UpdateLocalListenPort(): network: [redacted] error encountered checking local listen port:  nm-[redacted] file does not exist
GetFileWithRetry(): failed to retrieve file  /etc/netclient/config/traffic-[redacted] , retrying...
GetFileWithRetry(): failed to retrieve file  /etc/netclient/config/traffic-[redacted] , retrying...
Hello(): Network: [redacted] error publishing ping, open /etc/netclient/config/traffic-[redacted]: no such file or directory
Hello(): running pull on [redacted] to reconnect
ReplaceWithBackup(): used backup file for network:  [redacted]
Hello(): could not run pull on [redacted], error: open /etc/netclient/config/netconfig-[redacted]: no such file or directory
checkin(): collecting metrics for node [redacted]
publishMetrics(): failed to authenticate when publishing metrics could not read secrets file open /etc/netclient/config/secret-[redacted]: no such file or directory
Checkin(): checkin routine closed
...
## after Egress Gateway reboot
Checkin(): MQ client is not connected, skipping checkin...

Contributing guidelines

abhishek9686 commented 3 months ago

@charleswinsor please try it with latest version