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

Site to Site #62

Open
Schu- opened this issue Nov 29, 2020 · 3 comments
Open

Site to Site #62

Schu- opened this issue Nov 29, 2020 · 3 comments

Comments

@Schu-
Copy link

Schu- commented Nov 29, 2020

I have been working with this project and really like how it seems to work. I was wondering if there is an easy way to setup like a site to site connection with it. Maybe even a wg-gen-web to wg-gen-web configuration? Right now i might need to setup 2 wireguard interfaces so I can still achieve my site to site with one, while having another with client roaming clients.

Thanks for all the hard work in this tool.

@vx3r
Copy link
Owner

vx3r commented Nov 29, 2020

hi, what is missing for the site to site config ? You need to add a static route right ?
If you can describe what is needed for your config i can look at it.

@Schu-
Copy link
Author

Schu- commented Nov 29, 2020

Ahh sorry. Maybe I was not clear. So Site A has wg-gen-web setup. Site B also has wg-gen-web setup. There is no way for me to setup a client at Site A and import it into Site B. I have been able to modify the config files and make it so both endpoints have the right info on both sides. Problem is I am not able to set an Endpoint for a client. So they never actually try and connect to each other. If I modify the wg0 config file it gets overwritten as expected.

@kreditor0815
Copy link

kreditor0815 commented Aug 24, 2021

I'm also looking for a solution to this problem. As far as I can tell, the [Peer]-Section of the resulting wg0.conf is missing an "Entrypoint = $dns.of.remote.endpoint:51280" and "PersistentKeepalive = 25" Entries. As soon I add those two lines to the wg0.conf generated by wg-gen-web, my site2site vpn is working.

Beside this, I manipulated the "PublicKey = " and "PresharedKey = " entries in the peer-json, that is merged with the server.json to wg0.conf

It would be great to be able to set those client-specific settings via the web-ui. But to get this up and running it would be awesome to be able to set those settings in the according json-file.

Eg:
extended the Client struct in file https://github.com/vx3r/wg-gen-web/blob/master/model/client.go with those fields:

	Endpoint				string `json:"endpoint"`
	PersistentKeepalive		int `json:"persistentKeepalive"`

and maybe add checks accordingly.

Also in https://github.com/vx3r/wg-gen-web/blob/master/template/template.go
add the apropriate sections to the wgTpl-variable:

{{if ne .Endpoint "" -}}
Endpoint = {{ .Endpoint }}
{{- end }}
{{if ne .PersistentKeepalive 0 -}}
PersistentKeepalive = {{ .PersistentKeepalive }}
{{- end }}

As far as i saw, this should be enough to persist needed settings over regeneration of the wg0.conf-file. But that is just a result of a first look at the code.

What do you think?

Edit: I got it running with these modifications.

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

3 participants