I have setup my phone back to a default networking config and I believe I can achieve a similar setup to yourself in that through WiFi I get an IPv4 address and through the modem I get an IPv6 only address.
I did a couple of quick tests, I performed a series of ping tests with the modem and WiFi in various combinations of states. I wanted to check basic connectivity and as ping gives IP address in it’s output and we are dealing with both IPv4 and IPv6 it also gives me a basic indication on routing, as I’m pinging by server names this would also show any DNS delays. I could also test some expected failure/timeout scenarios.
As WiFi is expected to get priority, I started with modem and mobile data enabled only to check route switching…
With modem enabled, mobile data enabled and WiFi disabled…
:~$ ping ns1.cloudflare.com
PING ns1.cloudflare.com(abby.ns.cloudflare.com (64:ff9b::adf5:3a64)) 56 data bytes
64 bytes from abby.ns.cloudflare.com (64:ff9b::adf5:3a64): icmp_seq=1 ttl=55 time=42.8 ms
64 bytes from abby.ns.cloudflare.com (64:ff9b::adf5:3a64): icmp_seq=2 ttl=55 time=41.4 ms
64 bytes from abby.ns.cloudflare.com (64:ff9b::adf5:3a64): icmp_seq=3 ttl=55 time=38.4 ms
64 bytes from abby.ns.cloudflare.com (64:ff9b::adf5:3a64): icmp_seq=4 ttl=55 time=38.8 ms
^C
--- ns1.cloudflare.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 38.426/40.351/42.785/1.807 ms
You can see that the replies are coming from an IPv6 address as expected.
Then I left modem and mobile data enabled and also enabled WiFi and re-ran ping…
:~$ ping ns1.cloudflare.com
PING ns1.cloudflare.com (173.245.58.100) 56(84) bytes of data.
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=1 ttl=57 time=31.6 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=2 ttl=57 time=28.10 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=3 ttl=57 time=30.2 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=4 ttl=57 time=23.7 ms
^C
--- ns1.cloudflare.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 23.693/28.593/31.560/2.983 ms
You’ll note the replies are now coming from an IPv4 address, this confirms that WiFi is getting priority. I will also note that when running these tests I am not seeing any delays from initiating the ping to getting a response which suggests that DNS is also working fine.
Then I kept WiFi enabled and modem enabled but disabled mobile data…
:~$ ping ns1.cloudflare.com
PING ns1.cloudflare.com (173.245.58.100) 56(84) bytes of data.
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=1 ttl=57 time=33.4 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=2 ttl=57 time=18.6 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=3 ttl=57 time=40.4 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=4 ttl=57 time=34.10 ms
^C
--- ns1.cloudflare.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 18.573/31.842/40.419/8.092 ms
Ping functions as expected and replies continue to come from an IPv4 address.
Then I kept WiFi enabled and re-enabled mobile data (I wanted to check that WiFi retained priority and there wasn’t some sort of LTP (Latest Takes Precedence) rule going on)…
:~$ ping ns1.cloudflare.com
PING ns1.cloudflare.com (173.245.58.100) 56(84) bytes of data.
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=1 ttl=57 time=30.4 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=2 ttl=57 time=45.9 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=3 ttl=57 time=39.7 ms
64 bytes from abby.ns.cloudflare.com (173.245.58.100): icmp_seq=4 ttl=57 time=24.10 ms
^C
--- ns1.cloudflare.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 24.979/35.239/45.883/8.094 ms
Again, ping performs as expected with replies from an IPv4 address.
And finally back to modem enabled, mobile data enabled and WiFi disabled. This would check/confirm that routes are transfered back through modem when WiFi is disbaled/dropped/lost.
:~$ ping ns1.cloudflare.com
PING ns1.cloudflare.com(abby.ns.cloudflare.com (64:ff9b::adf5:3a64)) 56 data bytes
64 bytes from abby.ns.cloudflare.com (64:ff9b::adf5:3a64): icmp_seq=1 ttl=55 time=41.8 ms
64 bytes from abby.ns.cloudflare.com (64:ff9b::adf5:3a64): icmp_seq=2 ttl=55 time=51.5 ms
64 bytes from abby.ns.cloudflare.com (64:ff9b::adf5:3a64): icmp_seq=3 ttl=55 time=40.7 ms
64 bytes from abby.ns.cloudflare.com (64:ff9b::adf5:3a64): icmp_seq=4 ttl=55 time=56.10 ms
^C
--- ns1.cloudflare.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 40.691/47.748/56.980/6.795 ms
And yes, we are back to ping replies coming from an IPv6 address.
All of this tells me that routing and DNS are functioning correctly at my end.
I then tried to induce failures, with the modem and mobile data enabled and WiFi disabled, I started a ping. With ping running I then enabled WiFi, at this point ping continues to receive replies from an IPv6 address as expected. Then, with ping still running, I disabled mobile data, at this point ping’s output changed to “ping: sendmsg: Network is unreachable
” indicating the expected failure. The connection was established on the IPv6 cellular interface, with that interface gone there is no way to route the ping requests.
When the output went to “ping: sendmsg: Network is unreachable
” I terminated ping and immediately restarted it, ping came straight back with replies from an IPv4 address.
I also tested this in reverse, i.e. With just WiFi enabled I started a ping and received replies from an IPv4 address, I left ping running and enabled mobile data then disabled WiFi. As expected, when disabling WiFi ping’s output went to “ping: sendmsg: Network is unreachable
”. Terminating ping and immediately restarting it has ping come straight back with replies from an IPv6 address.
This all tells me that networking and routing on the phone is pretty solid (for me at least).