Pinephone seems tobe using 4G data instead of Wifi data
#8
Updated my mobian trixie installation to block IPv6 when wifi wlan0 is up with some exceptions. In order to receive, send or download MMS messages mobile data is needed. My carrier is an MVNO on the USA T-Mobile network. I found that enabling IPv6 to the T-Mobile defined ISP IPv6 internet space solved the problem. This enables DNS and interactions with the T-Mobile services that support MMS.

My setup adds firewall rules allowing IPv6 OUTPUT to T-Mobil(2607:7700::/32) and blocks all other IPv6 on wwu1i4. If wifi is not up then the rule is removed to enable data via IPv6 over mobile data.

Bash script added to: 
Quote:/etc/NetworkManager/dispatcher.d/99-manage-ipv6-rules.sh

Code:
#!/bin/bash

INTERFACE="$1"
STATUS="$2"

if [ "$INTERFACE" == "wlan0" ]; then
    if [ "$STATUS" == "up" ]; then
        # wlan0 is up, apply the ip6tables rules
        if ! ip6tables -C OUTPUT -o wwu1i4 -j DROP 2>/dev/null; then
            # Rule not present, add the rule
            ip6tables -A OUTPUT -p udp --dport 53 -j ACCEPT
            ip6tables -A OUTPUT -p tcp --dport 53 -j ACCEPT
            ip6tables -A OUTPUT -d 2607:7700::/32 -j ACCEPT
            ip6tables -A OUTPUT -o wwu1i4 -j DROP
        fi
    else
        if [ "$STATUS" == "down" ]; then
            # wlan0 is down, remove the ip6tables rules
            if ip6tables -C OUTPUT -o wwu1i4 -j DROP 2>/dev/null; then
                # Rule present, remove the rule
                ip6tables -D OUTPUT -o wwu1i4 -j DROP
                ip6tables -D OUTPUT -d 2607:7700::/32 -j ACCEPT
                ip6tables -D OUTPUT -p tcp --dport 53 -j ACCEPT
                ip6tables -D OUTPUT -p udp --dport 53 -j ACCEPT
            fi
        fi
    fi
fi

Hoping this will prevent mobile IPv6 usage when the phone is connected via wifi that is IPv4 only. Application IPv6 connections should fail falling back to IPv4 while MMS messages should continue to work.

If T-Mobile starts hosting debian repo on there IPv6 space then then I'll have a problem. Or will have to be more specific with the allowed IPv6 ranges.
  Reply


Messages In This Thread
RE: Pinephone seems tobe using 4G data instead of Wifi data - by puffchumpy - 02-20-2025, 02:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  bookworm vs trixie discussion for mobian in pinephone regular. zetabeta 62 17,122 05-14-2025, 03:28 AM
Last Post: anonymous
  How to use QR codes on Mobian Sid(unstable) Pinephone Pro biketool 1 537 01-02-2025, 12:47 PM
Last Post: zetabeta
  unofficial kali linux for pinephone help needed pinesmell 5 6,060 01-08-2024, 02:50 PM
Last Post: ERPlegend
  reset wifi hardware/driver when it dies through console on pp? tuxcall 4 3,265 07-18-2023, 08:54 AM
Last Post: junelung
  4G data on default startup / boot dcinoz 1 1,561 04-29-2023, 11:24 PM
Last Post: dcinoz
  Wifi doesn't work after update nickolas 2 2,294 04-14-2023, 10:07 AM
Last Post: nickolas
  Axolotl on PinePhone / Mobian arno_nuehm 219 228,640 03-26-2023, 01:49 AM
Last Post: shulamy
  PinePhone won't boot after software update jb2000 2 2,468 03-17-2023, 07:26 AM
Last Post: Zebulon Walton
Wink Pinephone lost graphic during mobian system upgrade cmpin 4 3,788 03-01-2023, 04:45 PM
Last Post: anonymous
  Recent install, no wifi user641 3 2,692 01-12-2023, 03:06 PM
Last Post: user641

Forum Jump:


Users browsing this thread: 1 Guest(s)