namespaced-wireguard-vpn icon indicating copy to clipboard operation
namespaced-wireguard-vpn copied to clipboard

wg set doesn't work, wg setconf works

Open gimmelemons opened this issue 3 years ago • 2 comments

For some reason, wg set doesn't work, I am having to resort to using wg setconf in /usr/bin/namespaced-wireguard-vpn-interface file -

wg setconf "$WIREGUARD_NAME" /home/user/Projects/wgns/wgns.conf
       # wg set "$WIREGUARD_NAME" \
       #     private-key <(echo "$WIREGUARD_PRIVATE_KEY") \
       #     peer "$WIREGUARD_VPN_PUBLIC_KEY" \
       #         endpoint "$WIREGUARD_ENDPOINT" \
       #         allowed-ips "$WIREGUARD_ALLOWED_IPS" || die

By 'doesn't work', I mean I cannot ping other wireguard clients using sudo ip netns exec vpn ping 10.66.66.1 To clarify, I have properly filled in env variables in /etc/namespaced-wireguard-vpn/namespaced-wireguard-vpn.conf file Following is my wgns.conf file -

 [Interface]
 PrivateKey = ****
 
 [Peer]
 PublicKey = ****
 PresharedKey = ****
 Endpoint = ****
 AllowedIPs = 0.0.0.0/0,::/0

OS - Arch Linux 5.16.2-arch1-1 Wireguard version - wireguard-tools v1.0.20210914

I don't know how to debug/check logs.

gimmelemons avatar Feb 01 '22 07:02 gimmelemons

That's odd. I don't know any particular reason setconf should work differently from the equivalent set call.

You can check if the systemd unit has any useful log output with

$ journalctl -eu namespaced-wireguard-vpn-interface.service

in case there's an error running the set command. But if the interface comes up and just doesn't work, that sounds like the command was successful and just didn't do what we expected.

chrisbouchard avatar Feb 11 '22 21:02 chrisbouchard

@chrisbouchard I'm seeing problems myself trying to set this up too. On some testing of the actual wg set command I get "fopen: No such file or directory"

hockeymikey avatar Mar 04 '23 06:03 hockeymikey