Skip to content

Allow multiple peers, tunnels, and proxies #47

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

Merged
merged 1 commit into from
Aug 21, 2022

Conversation

jordemort
Copy link
Contributor

  • Allow multiple peers; peer specific-stuff is broken out into a new PeerConfig struct, which DeviceConfig now contains an array of
  • Support the AllowedIPs configuration option on peers; if unspecified, defaults to allowing everything as before
  • Allow multiple tunnels & proxies by setting AllowNonUniqueSections: true on the INI parser

Tested with multiple peers, tunnels, and allowed IPs in my home network

@whyvl
Copy link
Owner

whyvl commented Aug 21, 2022

Would you happen to have an example config for testing out multiple peers / tunnels?

@jordemort
Copy link
Contributor Author

Sure, here's a heavily redacted version of what I'm running:

[Interface]
Address = 10.254.254.40/32
PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=

[Peer]
Endpoint = 192.168.0.204:51820
PublicKey = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY=
AllowedIPs = 10.254.254.100/32
PersistentKeepalive = 25

[Peer]
PublicKey = ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=
AllowedIPs = 10.254.254.1/32, fdee:1337:c000:d00d::1/128
Endpoint = 172.16.0.185:44044
PersistentKeepalive = 25


[TCPServerTunnel]
ListenPort = 5000
Target = service-one.servicenet:5000

[TCPServerTunnel]
ListenPort = 5001
Target = service-two.servicenet:5001

[TCPServerTunnel]
ListenPort = 5080
Target = service-three.servicenet:80

I've got a big server at home and a smallish VPS in the cloud. I want to expose some, but not all, of the services that I have on my big server to my VPS. With wireproxy, I can pick off specific ports and forward them to the VPS without putting my whole big server on the same VPN as it and potentially exposing more than I intended.

@jordemort
Copy link
Contributor Author

In the example config, the services on 10.254.254.40 are accessible to both peers at .1 and .100

@whyvl whyvl merged commit 8f05071 into whyvl:master Aug 21, 2022
whyvl added a commit that referenced this pull request Mar 16, 2023
Allow multiple peers, tunnels, and proxies
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

Successfully merging this pull request may close these issues.

2 participants