ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
3.77k stars 464 forks source link

Feature Request: configure ListenPort per client #557

Open DunklerPhoenix opened 3 months ago

DunklerPhoenix commented 3 months ago

Heho I had the problem that the hardware firewall was blocking the connection between my two servers.

Server A: Wireguard Server with wireguard-ui Server B: peer

Log Server A:

wireguard: wg-retrofit: Keypair 2352 destroyed for peer 36
wireguard: wg-retrofit: Keypair 2353 created for peer 36
wireguard: wg-retrofit: Handshake for peer 36 (serverB:46937) did not complete after 5 seconds, retrying (try 5)
wireguard: wg-retrofit: Sending handshake initiation to peer 36 (serverB:46937)
wireguard: wg-retrofit: Receiving handshake initiation from peer 36 (serverB:46937)
wireguard: wg-retrofit: Sending handshake response to peer 36 (serverB:46937)
wireguard: wg-retrofit: Keypair 2353 destroyed for peer 36
wireguard: wg-retrofit: Keypair 2354 created for peer 36
wireguard: wg-retrofit: Handshake for peer 36 (serverB:46937) did not complete after 5 seconds, retrying (try 6)

Log Server B:

wireguard: wg0: Handshake for peer 12 (serverA:port) did not complete after 5 seconds, retrying (try 5)
wireguard: wg0: Sending handshake initiation to peer 12 (serverA:port)
wireguard: wg0: Handshake for peer 12 (serverA:port) did not complete after 5 seconds, retrying (try 6)

The firewall of server B let the handshake requests to server A through but blocked the response. It was not possible to easily open the ports, because they are changeing with every connection attempt.

I got around this problem with setting the endpoint address and port on Server B and give server B under [interface] a static ListenPort.

It would be great if I can set the listenport for the client in the client view of wireguard-ui like the endpoint. Then the generated config directly has this option.