Data mobile 4G && IPv6

When I have a data mobile connection my wwan0 interface looks like this:

purism@pureos:~$ ifconfig wwan0 
wwan0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet6 2a02:3033:405:6020:404:39f5:5bda:1163  prefixlen 64  scopeid 0x0<global>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 3521  bytes 2477251 (2.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3011  bytes 524166 (511.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

With this I can’t access some providers (imap.1blu.de) others yes (www.muc.de). Is there a way to restrict the interface to IPv4?

i restrict my wwan to ipv4 due to IP leakage over VPN with IPv6 and Open VPN.

Use advanced network settings (gui for network manager) and scale it using mobile settings compositor scale the open app. When using it and changing and saving values you sometimes have to wait 2-3 minutes and thats probably just a ui bug, eventually it will take the change.

1 Like

Thanks. Which app is this or which must be installed? Or even better, could this be done from cmdline?

its the one with the wrench already installed by default.

Thanks. I did so, toggled Mobile data off/on and only IPv4 came up again. Big thanks.

1 Like

I’m having the same issue but after disabling ipv6 the wwan adapter never gets an ipv4 address.
Even after toggling Mobile data, hw switch or a reboot.

Have checked with Librem support and we’ve looked at various settings:
Note: I’ve censored my ipv6 address
`

purism@pureos:~$ sudo mmcli -m any -b 1
--------------------------------------
General | path:
/org/freedesktop/ModemManager1/Bearer/1
| type: default
--------------------------------------
Status | connected: no
| connection error name:
org.freedesktop.ModemManager1.Error.MobileEquipment.Unknown
| connection error message: Call failed: cm error: (null)
| suspended: no
| multiplexed: no
| ip timeout: 20
--------------------------------------
Properties | apn: internet
| roaming: allowed
| ip type: ipv4v6
| allowed-auth: none, pap, chap, mschap,
mschapv2, eap
--------------------------------------
Statistics | attempts: 1
| attempts: 1
purism@pureos:~$ sudo mmcli -m any -b 2
--------------------------------------
General | path:
/org/freedesktop/ModemManager1/Bearer/2
| type: default
--------------------------------------
Status | connected: no
| connection error name:
org.freedesktop.ModemManager1.Error.MobileEquipment.Ipv6OnlyAllowed
| connection error message: IPv6 only allowed
| suspended: no
| multiplexed: no
| ip timeout: 20
--------------------------------------
Properties | apn: internet
| roaming: allowed
| ip type: ipv4
| allowed-auth: none, pap, chap, mschap,
mschapv2, eap
--------------------------------------
Statistics | attempts: 1
| attempts: 1
purism@pureos:~$ sudo mmcli -m any -b 3
------------------------------------
General | path:
/org/freedesktop/ModemManager1/Bearer/3
| type: default
------------------------------------
Status | connected: yes
| suspended: no
| multiplexed: no
| interface: wwan0
| ip timeout: 20
------------------------------------
Properties | apn: internet
| roaming: allowed
| ip type: ipv6
| allowed-auth: none, pap, chap, mschap,
mschapv2, eap
------------------------------------
IPv6 configuration | method: static
| address:
ipv6 showing here
| prefix: 64
| gateway: ipv6 gateway showing here
| dns: ipv6 dns1 showing here, ipv6 dns2 showing here,
| mtu: 1500
------------------------------------
Statistics | duration: 300
| bytes rx: 2189285
| bytes tx: 397630
| attempts: 1
| total-duration: 300
| total-bytes rx: 2189285
| total-bytes tx: 397630
|purism@pureos:~$
`

Some mobile networks are IPv6 only.

Sometimes there are separate APNs available for IPv4 and IPv6, you may want to check it up with your provider.

I’ve got the correct APN set.

The provider’s phone howtos mention MCC and MNC settings, where would I configure these?

Edit:

Received an ipv4 address on wwan adapter after setting a different APN!

You would set those in Chatty as they are SMS and MMS related things.

Couldn’t find the options besides setting an APN in Chat (is that Chatty?), the options were grayed out and I couldn’t edit them.

After configuring the APN in Settings->Mobile->Access Point Names the APN options in Chat also were filled in and I could edit them, although it was named MMSC and showed a website, the APN was filled in like I did in Settings, the Proxy was also filled in.

On the commandline I found you can specify the APN/MCC-MNC using:
mmcli -m 4 --simple-connect=“apn=,operator-id=MCCMNC”

Ok figured out how to allow mms picture messages in chatty through ipv6 not tunnelled through openvpn, while not leaking ipv6 online in browser as much by setting ipv4 preference still being mostly tunneled through openVPN. I think thats a good compromise, maybe something purism could set as default:

/etc/gai.conf/

The default is:

precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
#precedence ::ffff:0:0/96 10

For sites which prefer IPv4 connections change the last line to

precedence ::ffff:0:0/96 100

1 Like