-
Notifications
You must be signed in to change notification settings - Fork 7
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
WireGuard CLI configuration #888
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ddd39a0
to
efb388d
Compare
Closed
134a207
to
9dd36b4
Compare
6c207b9
to
4c50c8f
Compare
filippocarletti
requested changes
Nov 28, 2024
aea67cf
to
0375101
Compare
filippocarletti
approved these changes
Nov 29, 2024
Tbaile
approved these changes
Nov 29, 2024
If ns_routes field is set inside a peer, it allows to create a net2net tunnel
Allow to enable and disable server instances and peers.
Also add ns_user_db field to connect an instance to a user db
Support automatic creation of preshared key for peers
Allow to use existing user as wireguard peer. Make sure to not conflict with OpenVPN config.
Enable debug for wireguard. Usage example: echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control
The API can be used to setup site-to-site tunnels
Co-authored-by: Filippo Carletti <filippo.carletti@gmail.com>
0375101
to
9f4630d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wireguard configuration from command line interface.
Features:
Limitations:
Possible improvements:
Reference: #921
Quickstart
1. Get good defaults
Before creating an instance, retrieve some valid defaults. Use the calculated defaults to create the instance:
Response example:
Debug
By default, wireguard does not log anything.
To enable logging on
/var/log/messages
, use the following:2. Create the instance
Create the instance not connected to a user db:
The server will automatically get the first IP of the
network
, in this case10.98.95.1
.Save and apply:
Use the same API also the change the configuration of the server instance.
3. Add a new account (peer)
Create a new account, make sure the
account
field is unique inside the same instance:Options:
route_all_traffic
: if set totrue
, when the client connects, it will send all the traffic to the serverclient_to_client
: if set totrue
, the client will be able to communicate with all other peers and not only with the serverpreshared_key
: if set totrue
, automatically create a pre-shared key that will be used in the peer downloaded configurationns_routes
: a list of network CIDR, automatically routes the networks to this peer; this is used for net2netNote: if the server instance is linked to a user_db, the
account
field must contain the name of an existing userSave and apply:
Use the same API also the change the configuration of the server instance.
4. Download the account configuration
The account configuration can be downloaded both in text format or a QR code.
Download the text format:
Configure an Desktop/Mobile device
Print the QR code to the console:
You can use the iOS or Android app to scan the QR code and connect.
Import the configuration to another NethSecurity
Print the configuration file in base64 to the console:
The output will be something like:
Copy the base64 string, than go the the other NethSecurity and execute:
Save and apply:
Remove an instance
To remove an instance use:
The command will remove:
Save and apply:
Remove a peer
To remove a peer use:
The command will remove the peer and it's configuration inside the users database, if present.
Save and apply: