Skip to content
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

wg set private-key does not give any output with wg show #348

Open
mvesin opened this issue Jun 6, 2023 · 0 comments
Open

wg set private-key does not give any output with wg show #348

mvesin opened this issue Jun 6, 2023 · 0 comments

Comments

@mvesin
Copy link

mvesin commented Jun 6, 2023

When running wg set wg0 private-key <(wg genkey), no error is received but wg show wg0 or wg showconf wg0 does not show output for the private-key or the public-key (or maybe own-public-key is the public-key, but then it is not displayer in wg

Am I missing something or is there an issue ?

# no error reported when querying
$ socat - UNIX-CONNECT:/var/run/wireguard/wg0.sock
get=1
listen_port=49683

errno=0

# no error reported when setting key
# checked that `wg genkey output` is ok
$ wg set wg0 private-key <(wg genkey)
$

# no error reported when setting key
$ socat - UNIX-CONNECT:/var/run/wireguard/wg0.sock
set=1
private_key=6040ad1d02595ad318d7b54673de74361d7cce0a1a617da5b851031243abe67a

errno=0

# but output does not seem to be coherent
$ socat - UNIX-CONNECT:/var/run/wireguard/wg0.sock
get=1
own_public_key=cf4ad568938b7535f70e7cc68c29e038b3022efb0fe5b9a6c9f76a7be5c71817
listen_port=49683
errno=0

$ wg show wg0
interface: wg0
  listening port: 49683

Context:

  • in docker container python:3.10-slim-bullseye, docker 20.10.12, on Fedora 38

    docker run --privileged --device /dev/net/tun -it  debian:bullseye-slim sh
    
  • boringtun-cli v0.5.2 installed with

    curl https://sh.rustup.rs -sSf | sh -s -- -y && . /root/.cargo/env && \
      cargo install --locked --bin boringtun-cli --version ~0.5.2 boringtun-cli
    
  • wg installed with apt-get update && apt-get install -y wireguard-tools
    Also tested with git clone https://git.zx2c4.com/wireguard-tools && make -C wireguard-tools/src && make -C wireguard-tools/src install

  • start boringtun as root in container with

    WG_SUDO=1 boringtun-cli wg0
    BoringTun started successfully
    
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

No branches or pull requests

1 participant