[Moto G Stylus 5G] whte_rbt.obj:
TL;DR

I have an unlocked Motorola Moto G 5G - 2023 XT2313-6. I've unlocked the bootloader and rooted the device using Magisk. It's on a 'Verizon Unlimited Plus' plan. Tethering gets throttled to 600 Kbps after 30 GB.

I want to turn my phone into a permanent cellular WAN gateway and I need to configure it such that Verizon doesn't see my data usage as "hotspot data".

I do not plan on using this phone for anything else. So I am willing to accomplish this by any means necessary.

--verbose

Hello, I have an unlocked Motorola Moto G 5G - 2023 XT2313-6, codename pnangn, I originally purchased the phone to replace the Moto One 5G UW XT2075-1, codename nairo, that I lost. I ended up filing claim and getting another XT2075-1 shipped to me to use as my primary mobile device because the XT2313 felt like a significant downgrade from the XT2075-1. The camera sucks and it doesn't do NFC / 'Tap to Pay'.

Now that I can safely say that I won't be using the XT2313 for things like mobile banking, etc. I have unlocked the bootloader and rooted the Moto XT2313-6 using Magisk.

I live in a ... I'll call it "sub-rural" area. The street I live on borders another state and my home is positioned in between two freight railways positioned about a mile apart from one another. There are probably other reasons, but I've concluded that this is why the 4 square mile area surrounding my home seems to be terribly underserved by telecom companies. Looking at the FCC's braodband map, nobody living in my area has access to infrastructure supporting fiber internet or even broadband cable internet.

Over the last year, I've been using a Cradlepoint CBA850 MC400LP6 with a Verizon SIM for my main Internet / WAN connection. It contains a Sierra Wireless MC7455, which is not a 5G modem. I've "repaired" the IMEI using AT!NVENCRYPTIMEI. It's using the IMEI of my old OnePlus phone. The Verizon plan is 'Verizon Unlimited Plus'. It is an unlimited plan for mobile devices and not a 'data only' plan. Most of the time, my internet is roughly 60 Mbps and I use between 400 and 800 GB of data every month. Verizon doesn't see this as 'hotspot' data because my pfSense firewall that the modem sits in front of rewrites the TTL on all packets to 65. Up until now, I was convinced that this was the best I could do. Until I purchased my unlocked XT2313-6.

While my experience with the XT2313-6 as my primary mobile device wasn't great, I did find, however, that the XT2313-6's SoC is a SM4350-AC. The SM4350-AC uses the Snapdragon X51 5G for cellular connectivity. The Snapdragon X51 5G supports C-band / mid-band 5G NSA connectivity (specifically band n77). This means that when I do a speed test on my XT2313-6, I regularly achieve speeds between 180 Mbps and 350 Mbps.

As a side note, I'm a bit confused as to why my XT2075-1 wasn't as fast as my XT2313-6 because my XT2075-1 apparently contains a Snapdragon X52 5G modem. I have a feeling that theres something in it's EFS that slowing it down because it's a Verizon-locked phone. Though, I will admit that when I'm in mmWave territory, the XT2075-1 can be faster than 2 Gbps.

So what I'd like to do is find a way to use my XT2313-6 as my primary internet connection. I also need to find a way to prevent Verizon from seeing my data usage as tethering because I'd otherwise be limited to 30 GB per month.

What I've tried

Connect XT2313-6 to Ubuntu laptop via USB and turn off mobile data in Android.

The Ubuntu laptop is connected to a Windows laptop with an Ethernet cable.

Like this:

╔════════Ubuntu═══════╗
[dhcp] ˂──── NAT ────˃ [192.168.0.1]
{wwan0} {eth0}═╗
╚═════════════════════╝ ║
║
╔═══════Windows═══════╗ ║
║ {Ethernet}═╝
║ [192.168.0.5]
╚═════════════════════╝

Expose DIAG port, ceullar modem, WWAN adapter, and ADB using

adb shell
su
setprop sys.usb.config diag,serial_cdev,rmnet,adb

The usb device now gets recognized as VID 05c6 PID 9091.

In init.mmi.usb.rc it's called QCOM Default Composition

Windows calls it "Qualcomm HS-USB Modem 9091".

/dev/cdc-wdm0 will be created in Ubuntu.

Then I use ModemManager to start the connection.

systemctl start ModemManager

ModemManager will bring up the wwan0 interface.

Enable IPv4 forwarding.

echo 1 > /proc/sys/net/ipv4/ip_forward

Use iptables to, among other things, configure routing and mangle TTL to 64.

iptables --flush
iptables -t mangle -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -t nat -A POSTROUTING -o wwan0 -j MASQUERADE
iptables -t filter -A FORWARD -i eth0 -j ACCEPT
iptables -t mangle -I POSTROUTING -o wwan0 -j TTL --ttl-set 64
iptables -t mangle -I PREROUTING -i wwan0 -j TTL --ttl-set 64
dpkg-reconfigure iptables-persistent

This gave me the most stable results until I found out that my data usage was being flagged as "hotspot data". ModemManager will simply terminate the connection with error pdn-ipv4-call-throttled.

I liked this method because it didn't require any interaction with the Android user interface apart from unlocking it once for ADB.

I've also tried VPN Hotspot app. I don't think this worked to hide my tethering usage. Also, I think the VPN configuration I was using slowed down my connection enough rule out this option.

I tried settings put global tether_dun_required 0 which didn't seem to have an effect.

My phone says that my APN is VZWINTERNET and my APN type is default,supl,dun. I'm reading about people adding DUN to their APN type so that tethering uses unmetered dial up network, but my APN already has dun in the APN type by default. I think I'm probably misunderstanding this method.

My question

Is there any way to turn my phone into a cellular WAN gateway such that Verizon doesn't see my data usage as "hotspot data"? Maybe a custom ROM or a custom recovery? Maybe I'm doing iptables wrong? Maybe there's a way to expose the modem as a MBIM or a ECM device instead of a QMI device?

Additionally, I used QCSuper to capture RRC / NAS attach procedures as well as logs produced from ModemManager --log-level=DEBUG --debug.

Thank you in advance for your help!