MindscapeHQ/raygun4android

IP Address when in Wifi behind NAT

TheRealAgentK opened this issue · 2 comments

It seems that quite often with devices in Wifi, the provider only logs an internal/NAT IP address.

That's not ideal for cross referencing data with other services and monitoring.

Tested with RG4A 3.0.x

a) Check if that's still the case with 4.x
b) If yes, look into a better solution and viability of other means to collect an external IP

Investigated this today a bit deeper and there's no way to - without an external service like Ipify or other "what's my IP" like services, there's no way to get to the public IP if the device is behind a NAT using a system or close-to-system API.

The reason is essentially that all we can get are the network interfaces on the Linux level inside Android - very similar to what an ifconfig would deliver.

Screenshot from 2024-10-14 17:30:15

Even if you're in a WLAN and have a wlan0 network available, all it will show is the address within your network if you're in a NAT network.

Similar is true for a mobile network, they're build slightly differently but in the vast majority of cases the Android network and telephony APIs don't expose this.

So, unless we want to include an optional 3rd party service (via a config flag for instance) to grab and include the public address of the device into a crash report, there's not really any great ways to improve the current behaviour.

Even if we were to go down such a path, it'd be another dependency to the provider that could fail in itself obviously and cause further issues.

Will raise with some folks internally for this decision, but at this stage, I lean towards closing via wontfix.

We're looking into an alternative solution on the ingestion side and this ticket will not be actioned.