Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ntfy on Android: can't connect to Ntfy server (on wifi) behind VPN when restricted to wifi only #1275

Open
GideonBear opened this issue Feb 6, 2025 · 1 comment
Labels
🪲 bug Something isn't working

Comments

@GideonBear
Copy link

🐞 Describe the bug

When I set Ntfy to "wifi only" in my settings (Samsung), it fails to connect to my Ntfy server over a WireGuard VPN, even on wifi (mobile data is off). When "Mobile data or wifi" is selected, it connects fine.

💻 Components impacted

Android app

💡 Screenshots and/or logs

https://nopaste.net/9iBLnfgCnN

🔮 Additional context

When "wifi only" is selected, I do get notifications over mobile data. Attachments fail to download.
This is probably related, and also an issue for me; I want to use as little mobile data as possible.

@GideonBear GideonBear added the 🪲 bug Something isn't working label Feb 6, 2025
@Ravindranathrl
Copy link

I've investigated this issue and found that it likely stems from how the WireGuard VPN routes traffic when restricted to "Wi-Fi only." The error logs indicate a java.net.ConnectException: Failed to connect to /172.17.0.1:1420, which suggests that the app is trying to connect to a local IP that may not be accessible over the VPN when only Wi-Fi is enabled.

Add the following to your WireGuard configuration to ensure all traffic, including Wi-Fi-only traffic, routes through the VPN:

AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 25

Use a Public IP Address Instead of a Local IP:

Replace 172.17.0.1 with the public IP address or domain of your Ntfy server. This ensures that traffic is routed correctly through the VPN tunnel, even on Wi-Fi.

Adjust Android VPN Settings:

Set the VPN to Always-on VPN and enable Block connections without VPN in Android settings.

Disable Mobile Data Always Active in Developer Options (if available) to force the device to rely entirely on Wi-Fi.

Check App Permissions:

Ensure that the app has these permissions in the Android manifest:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants