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

[Feature Request] List IPv6 Gateway and DNS information #131

Open
GoetzGoerisch opened this issue Apr 23, 2024 · 11 comments
Open

[Feature Request] List IPv6 Gateway and DNS information #131

GoetzGoerisch opened this issue Apr 23, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@GoetzGoerisch
Copy link

Overview

Currently the WiFi-Widget only lists the DNS, DHCP and Gateway information for IPv4.
Please also display and make it configurable for IPv6.

@w2sv
Copy link
Owner

w2sv commented May 8, 2024

Well there's no API for retrieving those addresses as IPv6s AFAIK, and I suppose just converting them from their IPv4 versions wouldn't be of much use, or am I wrong?

@GoetzGoerisch
Copy link
Author

@w2sv
Copy link
Owner

w2sv commented May 10, 2024

The InetAddresses returned by https://developer.android.com/reference/android/net/LinkProperties#getDnsServers() only contain the IPv4 host addresses.
https://developer.android.com/reference/android/net/LinkProperties#getRoutes() on the other hand returns various routes and addresses, which I, however, don't really know how to interpret. The class documentation at https://developer.android.com/reference/android/net/RouteInfo doesn't help me much either.

The RouteInfo instances it returns on my network contains the following information:

interface: wlan0 | gateway: /fe80::f1db:c284:67f6:e8d2 | destination: ::/0 | isDefaultRoute: true
interface: wlan0 | gateway: /:: | destination: 2a02:3032:2e0:5207::/64 | isDefaultRoute: false
interface: wlan0 | gateway: /fe80::f669:42ff:fea7:a73 | destination: ::/0 | isDefaultRoute: true
interface: wlan0 | gateway: /:: | destination: 2a02:3032:2e0:78f3::/64 | isDefaultRoute: false
interface: wlan0 | gateway: /fe80::7df4:c55f:14b4:7dc3 | destination: ::/0 | isDefaultRoute: true
interface: wlan0 | gateway: /0.0.0.0 | destination: 192.168.1.0/24 | isDefaultRoute: false
interface: wlan0 | gateway: /192.168.1.1 | destination: 0.0.0.0/0 | isDefaultRoute: true

192.168.1.1 is also my gateway, DNS and DHCP address shown on the widget, other than that none of those addresses is a duplicate of one featured by the widget.

Can you infer how to interpret them?

@w2sv
Copy link
Owner

w2sv commented May 10, 2024

The nat64Prefix I can definitely add, I created a separate issue for that @ #144.

@GoetzGoerisch
Copy link
Author

Default route IPv6

interface: wlan0 | gateway: /fe80::f1db:c284:67f6:e8d2 | destination: ::/0 | isDefaultRoute: true

Default route IPv6 for prefix 2a02:3032:2e0:5207::/64

interface: wlan0 | gateway: /:: | destination: 2a02:3032:2e0:5207::/64 | isDefaultRoute: false
interface: wlan0 | gateway: /fe80::f669:42ff:fea7:a73 | destination: ::/0 | isDefaultRoute: true

Default route IPv6 for prefix 2a02:3032:2e0:78f3::/64

interface: wlan0 | gateway: /:: | destination: 2a02:3032:2e0:78f3::/64 | isDefaultRoute: false
interface: wlan0 | gateway: /fe80::7df4:c55f:14b4:7dc3 | destination: ::/0 | isDefaultRoute: true

Default route IPv4:

interface: wlan0 | gateway: /0.0.0.0 | destination: 192.168.1.0/24 | isDefaultRoute: false
interface: wlan0 | gateway: /192.168.1.1 | destination: 0.0.0.0/0 | isDefaultRoute: true

@w2sv
Copy link
Owner

w2sv commented May 10, 2024

So these aren't DHCP or DNS addresses but an entirely separate property?

@w2sv
Copy link
Owner

w2sv commented May 10, 2024

Also, how can you tell that

interface: wlan0 | gateway: /:: | destination: 2a02:3032:2e0:5207::/64 | isDefaultRoute: false
interface: wlan0 | gateway: /fe80::f669:42ff:fea7:a73 | destination: ::/0 | isDefaultRoute: true

And

interface: wlan0 | gateway: /:: | destination: 2a02:3032:2e0:78f3::/64 | isDefaultRoute: false
interface: wlan0 | gateway: /fe80::7df4:c55f:14b4:7dc3 | destination: ::/0 | isDefaultRoute: true

respectively belong together, just by their order of appearance?
I'm not too much of a networking expert, as I guess isn't hard to spot.

@GoetzGoerisch
Copy link
Author

their belonging together was only based on the order of apperance.
On a normal linux host more information is given.
You have 2 prefixes assigned, probably due to the dynamic assignment by o2 every 24h.
One link-local address is derived from the interface MAC address, the others are random generated.
I would need to know more about the network and the setup to properly figure this out.

@w2sv
Copy link
Owner

w2sv commented May 10, 2024

Okay, so they actually don't have anything to do with the original issue subject. Do you think adding them to the displayable widget properties under the name "Route" would be of value anyways?

@GoetzGoerisch
Copy link
Author

Basically your device has more than one IPv6 Gateway configured. So this part matched the issue title. Nevertheless, there seam to be no obvious API to get the IPv6 DNS information, if I understood you and the documentation correctly?

@thomasschaeferm
Copy link

thomasschaeferm commented May 12, 2024

Just for information:

Gateway 0.0.0.0
DNS     0.0.0.0
DHCP    0.0.0.0

is definitely not correct, if there isn't ipv4 at wifi interface at all. The properties Gateway, DNS, DHCP should be hidden then. Or 0.0.0.0 should be replaced by something representing nothing/empty .

At the moment the app shows the correct public ipv4 ip(*).
The local ipv4 address (clat, usually 192.0.0.2) is only visible in system "about phone". DNS (IPv6!) is correctly shown in wifi connection settings, but not in that app.

Strictly speaking - clat is an extra interface. It appears, when uplink (wifi or cellular) provides nat64.

* under some circumstances you can have two different public ipv4 addresses. (one via clat interface and one directly via NAT64, but that configuration is a rarity on plat side)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants