Community discussions

MikroTik App
 
ngrigoriev
just joined
Topic Author
Posts: 3
Joined: Sun Jun 26, 2022 8:29 pm

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

Sun Nov 24, 2024 5:55 am

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
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22373
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

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

Sun Nov 24, 2024 8:01 pm

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.