r/WireGuard • • 3d ago

WireGuard client iPhone weird behavior

Have opnsense 26.7.9_3 at home
Trying to get a iPhone road warrior setup going

WireGuard client on iPhone, tunnel setup using a QR code in opnsense

Config “looks” good.

Endpoint in iPhone before activating correctly says xx.yy.zz.30:51820

When activating the tunnel, the endpoint instantly changes to an IPv6 address with port 51820

When I deactivate, the endpoint changes back to the ipv4 address i specified..

Is this normal?

6 Upvotes

9 comments sorted by

2

u/OldObject4651 3d ago

I’m on Mint mobile in US
How can I even check the address given to my phone…?

2

u/Gross_inc 3d ago

Visit wtfismyip.com
If you only see ipv6 (while on cellular) then you’re on ipv6 only

2

u/OldObject4651 3d ago

Showing both
172.56.169.x and
2607:fb91:…etc

1

u/JPDsNEWS 3d ago edited 3d ago

De-google: Is your cell/mobile carrier running IPv6 only?

Many mobile carriers are IPv6-only on the phone-to-network side, while using 464XLAT or similar translation so phones can still reach IPv4-only services. Others run dual-stack, so IPv6 support varies by carrier, country, plan, and device.

— DDG Search & Assist

What you’re seeing is Network Address Translation (NAT) at work!

2

u/OldObject4651 3d ago

Heh also;
When I use the peer generator, and it creates a 192.168.28.6/32 address, then I snap the QR code and the iPhone WireGuard app puts in 192.168.28.7/32 (not what peer generator gui shows)
What’s up with that

1

u/JPDsNEWS 3d ago

It’s assuming that 192.168.28.6/32 is your VPN server’s address (or your WG config’s [Interface] address) and that your [Peer] addresses are going to be in sequence following it; the first subsequent [Peer] address being 192.168.28.7/32.

2

u/mjbulzomi 3d ago

Is your cell/mobile carrier running IPv6 only? Does the IPv6 address begin with 64:ff9b?

Back in July, I was on holiday in Ireland from the USA, and I noticed my home's public IPv4 being translated to a 64:ff9b IPv6 address, and this was the case for me.

2

u/ananas7777 2d ago

Yeah, that's normal. The iOS app does it on purpose. When the tunnel starts it runs your endpoint back through getaddrinfo so DNS64 can kick in (there's literally a code comment saying so in DNSResolver.swift). On a NAT64 network, iOS turns your IPv4 endpoint into a synthesized IPv6 address, and the carrier's NAT64 translates it back to IPv4 on the way to your OPNsense. Turn the tunnel off and it just shows what's in your config again.

The 172.56 and 2607:fb91 addresses wtfismyip showed are both registered to T-Mobile, so that's your phone's side, not the endpoint. If the handshake completes and traffic flows, there's nothing to fix.

1

u/jonixas 1d ago

It seemingly is the same behavior I see for my personal tunnel, or the work related tunnels I use across multiple devices, although there it flips from a URL:PORT to IPv4:PORT, and reverts back when disconnecting.