LTE Modem only issues inet6 ip address. How to make it give ipv4 as well?

Setup using Network Manager on device dev/cdc-wdm0

I have seen this wiki article however have not read any relevant information on my issue.

When connected I see the ip given is only ipv6. It shows only inet6 with ip addr show and also there is no route create in ip route yet there is a route created in ip -6 route.

This is not a provider issue because on a different device it shows both inet/v4 route and also gives ipv6 address.

When doing mmcli -m X the capabilities show ipv4, ipv6 and ipv4v6. I would have expected the latter so why no v4?

sometimes it helps to deleted the ipv6 wan interface.

1 Like

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
1 Like

You mean via IP command?

Also I saw on mmcli, that the device is capable of qmi and also serial. mmcli says drivers: qmi, option.

There is a list on a thread online of apparently about 6 total interfaces it is possible to switch to. Qmi seems to be default and serial modem seems to be another, which sounds like what I may offer the solution and allow me to use a different port serialusb to connect and maybe that will give me ipv4.

My device is listed in usb_modeswitch howver it must be a different version, as the precise id code is not the same. I am trying to find out how to make a custom one to add it but it is hard to find the right info online. Any help appreciated.

Thus, how to add custom data to make it modeswitch? I know to add the precise code of the device but do I also have to made a corresponding config file to place somewhere? If so what must go in it?

As an example I use T-Mobile USA. Their network only supports IPv6 (every packet between your modem and the tower must have IPv6 addresses), however they provide a NAT64 for access to IPv4 only Internet sites. At the customer's location, the IPv4 WAN is what I call a psuedo dual stack where IPv4 is translated to v6 compatible with NAT64. In OpenWrt, this translator is called 464-xlat.

Some modems implement 464 internally but with others you may need to run it in your router.

2 Likes

I just ran:

$ mmcli -m 21 --simple-connect="apn=provider.com" error: couldn't connect the modem: 'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.Ipv6OnlyAllowed: IPv6 only allowed'

Is there not a way to force it then in modemmanager, given that the isp gives one on different modem but not this one? I see there are some options like:

'''--create-bearer=['KEY1=VALUE1,KEY2=VALUE2,...']

Create a new packet data bearer for a given modem. The KEYs and some VALUEs are listed below:

'ip-type'

    Addressing type. Given as a MMBearerIpFamily value (e.g. 'ipv4', 'ipv6', 'ipv4v6'). Optional in 3GPP and CDMA.'''

Also, after connection, in mmcli -m x it shows initial-bearer ip type as ipv4v6

So is there some way to force it to ipv4 in mmcli?

I do not understand all the options yet and/or whether they will work or just be ignored and default to ipv6 somehow.

Hmm strange. I tried with each different type of bearer and even with ipv6 set as bearer it still comes up with the same error message:

$ mmcli -m 22 --simple-connect="apn=provider.com" --create-bearer=['ip-type=ipv6'] error: couldn't connect the modem:'GDBus.Error:org.freedesktop.ModemManager1.Error.MobileEquipment.Ipv6OnlyAllowed: IPv6 only allowed'

Make sure usb_modeswitch is not installed on your router.
Show the output of cat /sys/kernel/debug/usb/devices
You do not need to provide any other information yet.

T: Bus=01 Lev=03 Prnt=126 Port=02 Cnt=03 Dev#= 7 Spd=480 MxCh= 0
DT: Bus=01 Lev=03 Prnt=126 Port=02 Cnt=03 Dev#= 7 Spd=480 MxCh= 0
D: Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=2001 ProdID=7e3d Rev= 2.28
S: Manufacturer=Mobile Connect
S: Product=Mobile Connect
S: SerialNumber=xxxxxxxxxxxxxxxx
C:* #Ifs= 6 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E: Ad=8a(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

OK, this is "good" DWM-222.
Uninstall ModemManager and follow recommendations for QMI modems found in https://openwrt.org/docs/guide-user/network/wan/wwan/ltedongle
Make sure you do not set any custom DNS server.
Once you have IPv6 connection established, check the following and post the results:

nslookup ipv4only.arpa.
ping openwrt.de