PINE64

Full Version: Always Use Mobile Data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there Everyone,

I am messing around with using the PP to send myself email message reports with metrics from some yard equipment that are all connected on a WLAN.

I'm running into an issue where the PP will not use mobile data for internet access while it is connected to my WLAN, even though the WLAN itself is not connected to the internet.

Does anyone know of a way to set the PP to always use mobile data for connecting to the internet while also still being able to talk to other devices on a WLAN?

(04-18-2023, 11:54 AM)DingDangDoong Wrote: [ -> ]Hello there Everyone,

I am messing around with using the PP to send myself email message reports with metrics from some yard equipment that are all connected on a WLAN.

I'm running into an issue where the PP will not use mobile data for internet access while it is connected to my WLAN, even though the WLAN itself is not connected to the internet.

Does anyone know of a way to set the PP to always use mobile data for connecting to the internet while also still being able to talk to other devices on a WLAN?

I got it lol Big Grin 

For some reason I thought the wireless data connection would be handled differently from other internet connections but when I ran "ip route list" it was there!

I added the ip address from the mobile data connection as a default with "ip route add default via xxx.xxx.xxx.xxx dev wwan0" and now I can use WLAN and connect to the internet via mobile data!

-Doong
Be warned that "ip route add default" does not persist across reboots. The defaults are normally handled by NetworkManager.
(04-19-2023, 12:46 AM)Kevin Kofler Wrote: [ -> ]Be warned that "ip route add default" does not persist across reboots. The defaults are normally handled by NetworkManager.

Thank you for that tip!

I've un-marked this as solved because of something else I've noticed...

Flushing the default IP routes and making a new one with wwan0's ip address works for only a limited time, even if the phone is not power cycled.

Something running in the background is noticing that I'm removing the wlan0 route as default and putting it back! I'm having a difficult time figuring out what that is. 

Does anyone know what service puts the wlan0 IP as a default route? I'd rather suppress that behavior than make a new service to continually monitor and clear the wlan0 default that keeps popping up.
Probably the NetworkManager service.

You want to configure the metric of the connections in NetworkManager, keeping in mind that a lower metric = higher priority.

See, e.g., https://dev.to/emamirazavi/how-to-set-me...ystem-4525
(04-19-2023, 04:12 PM)Kevin Kofler Wrote: [ -> ]Probably the NetworkManager service.

You want to configure the metric of the connections in NetworkManager, keeping in mind that a lower metric = higher priority.

See, e.g., https://dev.to/emamirazavi/how-to-set-me...ystem-4525

That's got it! Thank you so much!

-Doong