Wireguard - Handshake not completing

Hi there,

I installed the Wireguard Addon and it appears to fail at the handshake with the iphone App.
I added the connection via the QR Code so pretty certain it’s correct. Port is forwarded in my router.
HA runs on a Pi4 that is directly connected to my router via Ethernet.

I’ve added and re-added the connection a few times but no luck. Tried different ports.

Any advice appreciated :slight_smile:

Config:

Peers

  • addresses:
    • 172.27.66.2
      allowed_ips: []
      client_allowed_ips: []
      name: iphone

Server:
addresses:

Server log:

[19:45:59] INFO: Requesting current status from WireGuard...
interface: wg0
  public key: zfRYbgpTte+gi5N4/wZppSR1hLkjgHrdlEmBt/n1qXXXX=
  private key: (hidden)
  listening port: 51820
peer: cew30T5eku8nSBuZZFKGQGTE0GIB+n0fjejqiXXXX=
  allowed ips: 172.27.66.2/32
  persistent keepalive: every 25 seconds
[19:46:29] INFO: Requesting current status from WireGuard...
interface: wg0
  public key: zfRYbgpTte+gi5N4/wZppSR1hLkjgHrdlEmBt/nXXXX=
  private key: (hidden)
  listening port: 51820

Iphone App:

2022-07-10 19:55:06.232833: [APP] startActivation: Entering (tunnel: XXX)
2022-07-10 19:55:06.233677: [APP] startActivation: Starting tunnel
2022-07-10 19:55:06.233836: [APP] startActivation: Success
2022-07-10 19:55:06.237716: [APP] Tunnel ‘XXX’ connection status changed to ‘connecting’
2022-07-10 19:55:06.291088: [NET] App version: 1.0.15 (26)
2022-07-10 19:55:06.291193: [NET] Starting tunnel from the app
2022-07-10 19:55:06.809077: [NET] DNS64: mapped 31.201.47.243 to itself.
2022-07-10 19:55:06.809693: [NET] Attaching to interface
2022-07-10 19:55:06.809950: [NET] Routine: encryption worker 4 - started
2022-07-10 19:55:06.809968: [NET] Routine: encryption worker 2 - started
2022-07-10 19:55:06.809984: [NET] UAPI: Updating private key
2022-07-10 19:55:06.809993: [NET] Routine: decryption worker 2 - started
2022-07-10 19:55:06.810043: [NET] Routine: handshake worker 1 - started
2022-07-10 19:55:06.810078: [NET] Routine: decryption worker 1 - started
2022-07-10 19:55:06.810084: [NET] Routine: handshake worker 2 - started
2022-07-10 19:55:06.810114: [NET] Routine: encryption worker 1 - started
2022-07-10 19:55:06.810113: [NET] Routine: encryption worker 3 - started
2022-07-10 19:55:06.810149: [NET] Routine: handshake worker 3 - started
2022-07-10 19:55:06.810168: [NET] Routine: decryption worker 6 - started
2022-07-10 19:55:06.810177: [NET] Routine: handshake worker 5 - started
2022-07-10 19:55:06.810197: [NET] Routine: decryption worker 3 - started
2022-07-10 19:55:06.810195: [NET] Routine: handshake worker 6 - started
2022-07-10 19:55:06.810214: [NET] Routine: decryption worker 4 - started
2022-07-10 19:55:06.810227: [NET] UAPI: Removing all peers
2022-07-10 19:55:06.810298: [NET] Routine: handshake worker 4 - started
2022-07-10 19:55:06.810296: [NET] Routine: decryption worker 5 - started
2022-07-10 19:55:06.810313: [NET] Routine: TUN reader - started
2022-07-10 19:55:06.810328: [NET] Routine: encryption worker 5 - started
2022-07-10 19:55:06.810328: [NET] Routine: encryption worker 6 - started
2022-07-10 19:55:06.810501: [NET] Routine: event worker - started
2022-07-10 19:55:06.810751: [NET] peer(zfRY…1qW8) - UAPI: Created
2022-07-10 19:55:06.810842: [NET] peer(zfRY…1qW8) - UAPI: Updating endpoint
2022-07-10 19:55:06.811071: [NET] peer(zfRY…1qW8) - UAPI: Updating persistent keepalive interval
2022-07-10 19:55:06.811199: [NET] peer(zfRY…1qW8) - UAPI: Removing all allowedips
2022-07-10 19:55:06.811241: [NET] peer(zfRY…1qW8) - UAPI: Adding allowedip
2022-07-10 19:55:06.811516: [NET] UDP bind has been updated
2022-07-10 19:55:06.811548: [NET] Routine: receive incoming v4 - started
2022-07-10 19:55:06.811557: [NET] peer(zfRY…1qW8) - Starting
2022-07-10 19:55:06.811573: [NET] Routine: receive incoming v6 - started
2022-07-10 19:55:06.811653: [NET] peer(zfRY…1qW8) - Sending keepalive packet
2022-07-10 19:55:06.811685: [NET] peer(zfRY…1qW8) - Sending handshake initiation
2022-07-10 19:55:06.811731: [NET] peer(zfRY…1qW8) - Routine: sequential sender - started
2022-07-10 19:55:06.811763: [NET] peer(zfRY…1qW8) - Routine: sequential receiver - started
2022-07-10 19:55:06.812455: [NET] Interface state was Down, requested Up, now Up
2022-07-10 19:55:06.812495: [NET] Device started
2022-07-10 19:55:06.812580: [NET] Tunnel interface is utun3
2022-07-10 19:55:06.812989: [NET] Network change detected with satisfied route and interface order [en0, pdp_ip0]
2022-07-10 19:55:06.813212: [NET] DNS64: mapped 31.201.47.243 to itself.
2022-07-10 19:55:06.813275: [NET] peer(zfRY…1qW8) - UAPI: Updating endpoint
2022-07-10 19:55:06.813475: [NET] Routine: receive incoming v4 - stopped
2022-07-10 19:55:06.813494: [NET] Routine: receive incoming v6 - stopped
2022-07-10 19:55:06.813716: [APP] Tunnel ‘XXX’ connection status changed to ‘connected’
2022-07-10 19:55:06.813742: [NET] UDP bind has been updated
2022-07-10 19:55:06.813749: [NET] Routine: receive incoming v4 - started
2022-07-10 19:55:06.813771: [NET] Routine: receive incoming v6 - started
2022-07-10 19:55:07.396634: [NET] Network change detected with satisfied route and interface order [en0, utun3, pdp_ip0]
2022-07-10 19:55:07.397391: [NET] DNS64: mapped 31.201.47.243 to itself.
2022-07-10 19:55:07.397767: [NET] peer(zfRY…1qW8) - UAPI: Updating endpoint
2022-07-10 19:55:07.398146: [NET] Routine: receive incoming v4 - stopped
2022-07-10 19:55:07.398212: [NET] Routine: receive incoming v6 - stopped
2022-07-10 19:55:07.398723: [NET] UDP bind has been updated
2022-07-10 19:55:07.398751: [NET] Routine: receive incoming v4 - started
2022-07-10 19:55:07.398835: [NET] Routine: receive incoming v6 - started
2022-07-10 19:55:12.082866: [NET] peer(zfRY…1qW8) - Handshake did not complete after 5 seconds, retrying (try 2)
2022-07-10 19:55:12.083175: [NET] peer(zfRY…1qW8) - Sending handshake initiation
2022-07-10 19:55:17.247829: [NET] peer(zfRY…1qW8) - Handshake did not complete after 5 seconds, retrying (try 2)
2022-07-10 19:55:17.248031: [NET] peer(zfRY…1qW8) - Sending handshake initiation
2022-07-10 19:55:22.532360: [NET] peer(zfRY…1qW8) - Handshake did not complete after 5 seconds, retrying (try 3)

Without the full config it’s not easy to debug and i have done setups manual.
Have you set the port of your host in the config XXX.duckdns.org:12345 would be my first thought and doesn’t there have to be the allowed ips in the configs?