Page 1 of 1

Wireguard show-client-config generates ListenPort value when not set

Posted: Sun Nov 24, 2024 5:55 am
by ngrigoriev
Hello,

I wanted to take advantage of show-client-config command to provide the config to my client from the "source of truth". The client was Android (Wireguard app). However, I have noticed that my connection did not work, there was some outgoing traffic and no incoming. After messing around I have found the reason: ListenPort set to some specific value in the [Interface] section. 51820 in my case. Seems to be the same value for all client configs. However, I never configured "client-listen-port" value for any of the peers. Even explicitly setting it to 0 does not change anything, it still generates 51820.

Turns out, Wireguard Android app does not support this value. And, in fact, it would be incorrect to set it because I am not in control of the port allocation on the client side. Wireguard documentation states that this value is optional.

Why does RouterOS generate ListenPort value when not needed?

Thanks!

P.S. RouterOS 7.15

Re: Wireguard show-client-config generates ListenPort value when not set

Posted: Sun Nov 24, 2024 8:01 pm
by anav
The listen port is a horrible name I will agree. It only pertains to a wireguard router that is server for handshake.
In the case of a client that port (typically identified under Wireguard Interface) is simply the outgoing port the initial connection uses to reach the Server etc.........
So in a client config its there for a reason for it, but it could be any port.