-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
DietPi-Software | WireGuard: Install fine tuning #2420
Conversation
+ DietPi-Software | WireGuard: Unmasking kernel packages is not required, since overridden by apt-get install. As well it fails and breaks install (G_RUN_CMD), if a package is not yet installed. + DietPi-Software | WireGuard: Do not force reboot after kernel updates, instead inform user via prompt, if no automated reboot is triggered. + DietPi-Software | WireGuard: Do not reinstall wireguard-dkms to rebuild the kernel module, instead use dpkg-reconfigure, and, only if it was no fresh install. + DietPi-Software | WireGuard: Estimate required reboot by checking modprobe exit code; Enable IP forwarding and start service for current session only, if WireGuard module has been successfully enabled + DietPi-Software | WireGuard: Do not overwrite any existing keys or configs + DietPi-Software | WireGuard: Enable IPv6 tunnel and forwarding + DietPi-Software | WireGuard: Add comments to default client config about how to tunnel local network or server access only, DNS server choice and multiple clients
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fourdee If indeed we find users/devices where it somehow doesn't (e.g. also during Beta phase), we can still revert and it's at least very easy to fix manually as well. Just two quick questions, maybe you have some deeper insight about it:
Ah and would be great to have some hints about how to configure WireGuard as client. Although, usually the provider should serve a config file. Perhaps we can add a simple script, instructions or additional whiptail based prompt, to enable a given client config (and skip the server config part). |
@Michalng |
VPN is point to point tunnel at a basic level. Additional routing can be setup on the server as required (eg: external routing + internet access). In example of NordVPN, you effectively use the internet from the VPN server. New external IP address is then visible.
|
@Fourdee Do you know how to achieve this using |
https://pastebin.com/XpcCXp0G Here is how Mullvad runs their wireguard client script FYI |
@HiDef888 Okay the script creates a key pair locally and sends the public key to the Mullvad server API to receive the config file (entries). This then looks pretty much the same as our client config:
So I guess we can expect all VPN providers (supporting WireGuard) will either have such an config script/installer, a prepared config file or documentation about how (with which entries) to create one. The key pair creation high likely is always included in this, since the VPN server of course needs to know/allow the clients public key.
Only question is:
to start and enable it. EDIT: finished! |
https://mullvad.net/en/guides/wireguard-and-mullvad-vpn/ FAQ on mullvad has some interesting features listed that may be worthwhile Q: How do I enable a kill switch? PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark Issue man wg-quick for more information. Q: How do I make WireGuard start automatically on boot ? It appears you're spot on with the systemd enable to get it to autostart. Additionally the inclusion of a killswitch would be fantastic which they address in their FAQ. I do expect as more VPNs include WG that they will probably use this script from mullvad. This particular script was written by the WG creator. I have been running a modified script from one of our fellow forum users that uses openvpn along with Monit and it works amazingly well to monitor the Interface (tun0) and reup the connection if it happens to fail. This would also be applicable to a (wg0) interface with a little modification. https://dietpi.com/phpbb/viewtopic.php?f=15&t=3074 If you need me to help with that I may be able to do so. I am not a programmer by trade however I can do some basic bash work. I think it would be neat to see something like this in a whiptail menu to setup a VPN client. It always seems to be a big hurdle to not only help people setup a VPN but to do it correctly. I think WG goes a long way in simplification of that process vs OpenVPN. |
@HiDef888 About the kill switch:
|
Okay passed retest with client and server choice. Will merge. For now I think we will add the kill switch info to our online docs, also because this requires copy&paste which cannot be done well from the prompt. I added this as info to the beta ToDo: https://github.com/Fourdee/DietPi/issues/2415 |
Status: Ready
Testing:
Print QR code to console to scan with mobile client:
qrencode -t ansiutf8 < /etc/wireguard/wg0-client.conf
Commit list/description: