angristan / wireguard-install

WireGuard VPN installer for Linux servers
https://stanislas.blog/2019/01/how-to-setup-vpn-server-wireguard-nat-ipv6/
MIT License
7.48k stars 1.26k forks source link

script generates invalid key? #497

Open ballo opened 4 months ago

ballo commented 4 months ago

Hello. Short version: I ran your script, it generated a .conf file, but I cannot use this with my mac wireguard client:

Screenshot 2024-03-04 at 11 13 43 AM

I'm not sure how to proceed from here.

Long version: I'm attempting to use wireguard to get around a mysterious bug that disallows routing between my VM and host (Macbook M2 host, Linux arm guest as the router). With previous versions of everything I could do this via ip masquerade which was ideal as it was fast and hardly used any CPU (no encryption, no tunneling, etc.) Now, due to a bug that neither Apple nor Parallels want to admit exists let alone address, this nice solution no longer works. I can get other VMs to use the linux router, but not the host OS.

Anyway, my current hald-assed solution is to use ssh tunneling which hardly works and also has the side effect of bypassing my (mac-side) firewall. Not good even under ideal conditions. I tried wireguard as an alternative to see if it would work any better but got the above error.

angristan commented 4 months ago

That's pretty weird, as you're the first to report this kind of issue, I would assume an issue with your setup.

What OS is running on the host you're running the script on?

Could you post the generated config?

ballo commented 4 months ago

So it doesn't appear to be complete. My guess is the script doesn't check if the installation succeeded and just blindly executes commands

[Interface]
PrivateKey = 
Address = 10.66.66.2/32,fd42:42:42::2/128
DNS = 1.1.1.1,1.0.0.1

[Peer]
PublicKey = 
PresharedKey = 
Endpoint = 10.37.129.3:63333
AllowedIPs = 0.0.0.0/0,::/0
ballo commented 4 months ago

I got the script to populate the config file correctly by uninstalling then reinstalling. I think the install failed and the script doesn't check for that. Anyway, the Mac client is now "Active" but there is no connection.

The script prompted for a "public" interface and I entered the one I use to connect to the virtual network, i.e. the interface I use to ssh to the VM from the Mac guest: eth0. I presume that was correct

ballo commented 2 months ago

This script blindly executes commands without checking for errors or even providing any output to debug issues. wg is executed blindly, for example.