Iphone client cannot connect to wireguard server


I just setup a wireguard server and I cannot connect my iphone to this server. don't know why, before I use freebsd computer as wireguard server was OK.
server conf:


peer conf:


iphone conf:

Endpoint ="server ip:8161"
AllowedIPs = "server LAN"
1 Like

Missing port opening firewall rule.

Missing client address, private key.

my iphone conf was working before (freebsd as wireguard sever).
and I have also setup site to site peers was OK.
Just iphone not working.

1 Like
wg show
interface: wg0
  public key: *********************
  private key: (hidden)
  listening port: 8161

peer: ********************
  endpoint: anotherWAN:8161
  allowed ips: LAN.0/24
  latest handshake: 1 minute, 13 seconds ago
  transfer: 1.63 MiB received, 18.83 MiB sent
peer: ***************
  allowed ips:
1 Like
iptables-save -c -t filter | grep -e 8161
1 Like

[0:0] -A zone_wan_input -p udp -m udp --sport 8161 -m comment --comment "!fw3: Allow-Wireguard-Inbound" -j ACCEPT

1 Like

This is wrong.
You need to use the dest_port option.

1 Like

I need change "8161" to "dest_port" at the Source port ?

The rule should match the destination port, not the source port.

1 Like

thanks a lot, it works

1 Like

I have another question,
this router was connect to one side router, I just setup to use wireguard.
I have found as the site to site VPN I can only ping the side router's ip, other computers from side router all I cannot access.

It's best to mark this thread as solved and open a new one providing the proper diagnostics from both sides of the tunnel.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.