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

Modifying port for Netclient prior to Netmaker Install ? #666

Open
gigadjo opened this issue Jan 5, 2024 · 1 comment
Open

Modifying port for Netclient prior to Netmaker Install ? #666

gigadjo opened this issue Jan 5, 2024 · 1 comment

Comments

@gigadjo
Copy link

gigadjo commented Jan 5, 2024

Hello, and thanks for Netmaker, it's a great tool !

Tho, i've been using it for a short time, i came across a problem : i try to connect to Netmaker from a filtered network, stateful firewall rules won't allow connecting from some network on some ports (in short).

Thus, some ports, are actually not filtered, because of probably 'internal use case'. I tried to set a simple Wireguard connexion on those ports, and it works very well.

I Found this parameter laying in https://github.com/gravitl/netclient/blob/develop/config/config.go

DefaultListenPort = 51821
// DefaultMTU default MTU for wireguard
DefaultMTU = 1420

It's then copied to /etc/netclient/netclient.yml

os: linux
interface: netmaker
debug: false
listenport: 51821
wg_public_listen_port: 51821
mtu: 1420

Is there a way, i did not figure out, how to pass this as a parameter during install process ?
As it seem to be read from file, even setting the value as an env_var may not work properly :-)

One can still use after install, or even afterward :

nmctl host update <host_id> --listen_port

As far as you disable / re-enable clients, their WireGuard config is rewritten, i don't know how it works for netclients 'clients' :-)

But it would be nice to be able to choose the port used from the start :-)

Thanks again for making such a great tool Open Source, best regards,

/joen

@yabinma
Copy link
Collaborator

yabinma commented Jan 26, 2024

@gigadjo , How you defined the config file? As I tested with,

host:
    listenport: 51825

After the installation, the port listens on 51825

tcp6 0 0 :::51825 :::* LISTEN

test done in v0.21.2

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