Latest step by step guide for creating 4G/LTE router

After Googling for Openwrt 4G LTE router I find quite a lot of hits, but cannot work out which is the most uptodate. Is there a recent guide for setting one up?

It depends on the protocol of the LTE interface, but they are gathered here.

Thanks for the pointer... I'm hoping to use RNDIS.

As usually happens I try following instructions put the results are not as described. I installed the required
opkg install kmod-usb-net-rndis usb-modeswitch
but the dmesg I should have expected did not appear.

One msg I got was:-

ifconfig usb0
ifconfig: usb0: error fetching interface information: Device not found

... nothing about RNDIS
Should I be using a particular version of OpenWrt? I have 18.06.02.

You'll need to provide some more information. Router model and usb dongle model.
18.06.2 is a bit old and unsupported. You can go ahead and upgrade to 18.06.8.

I'm actually using a Lenovo ThinkPad X201 as the host. My aim is to work out what steps I need to take to get it setup. I will upgrade OpenWrt although I'd prefer to upgrade to the latest version - not sure if there is a simple upgrade path from 18.06.2 to 19.07.2.
I have two Huawei E3372 USB dongles - one is the HiLink variety - this is the output from lsusb for this one:-

Bus 001 Device 007: ID 12d1:14dc Huawei Technologies Co., Ltd. E33372 LTE/UMTS/G

The other one is the one marketed as a Megafon 4G+ :-

Bus 001 Device 008: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard

Just upgrade without keeping the settings and then restore manually the settings. Every major release (17, 18, 19) is better installed fresh.

Mine is working fine with NCM protocol.

I've upgraded to 19.07.2, although one problem I have, which I also had previously is that I can hardly see the screen. The text is very dark - like dark grey on black. It only changes to this some way into the boot process, I guess when the video mode changes...

As for the USB Modems....

My HiLink

Bus 002 Device 009: ID 12d1:14dc Huawei Technologies Co., Ltd. E33372 LTE/UMTS/G

Dmesg:-

[ 7217.070078] usb 2-1: new high-speed USB device number 8 using ehci-pci
[ 7217.329348] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 7217.332232] scsi host2: usb-storage 2-1:1.0
[ 7217.395575] usb 2-1: USB disconnect, device number 8
[ 7218.080079] usb 2-1: new high-speed USB device number 9 using ehci-pci
[ 7218.491120] cdc_ether 2-1:1.0 eth1: register 'cdc_ether' at usb-0000:00:1d.7-1, CDC Ethernet Device, 0c:5b:8f:27:9a:64
[ 7218.494198] usb-storage 2-1:1.2: USB Mass Storage device detected
[ 7218.497586] scsi host2: usb-storage 2-1:1.2
[ 7219.525733] scsi 2:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI:2
[ 7219.534314] sd 2:0:0:0: [sdc] Attached SCSI removable disk

root@OpenWrt:~# ifconfig usb0
ifconfig: usb0: error fetching interface information: Device not found

MegaFon:-

Bus 002 Device 010: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard

Dmesg:-

[ 7218.080079] usb 2-1: new high-speed USB device number 9 using ehci-pci
[ 7218.491120] cdc_ether 2-1:1.0 eth1: register 'cdc_ether' at usb-0000:00:1d.7-1, CDC Ethernet Device, 0c:5b:8f:27:9a:64
[ 7218.494198] usb-storage 2-1:1.2: USB Mass Storage device detected
[ 7218.497586] scsi host2: usb-storage 2-1:1.2
[ 7219.525733] scsi 2:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  2.31 PQ: 0 ANSI: 
[ 7219.534314] sd 2:0:0:0: [sdc] Attached SCSI removable disk
[ 7418.702876] usb 2-1: USB disconnect, device number 9
[ 7418.708019] cdc_ether 2-1:1.0 eth1: unregister 'cdc_ether' usb-0000:00:1d.7-1, CDC Ethernet Device
[ 7436.140076] usb 2-1: new high-speed USB device number 10 using ehci-pci

ifconfig usb0 gives the same result as before, but I guess I must be addressing the wrong USB port. Dmesg mentions usb 2-1 but I don't know how to address that using ifconfig.

The guide is here and doesn't mention anything about ifconfig usb0

Connect over SSH from a different workstation.

@balanga Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik

Please edit your posting accordingly.
Thanks!

2 Likes

I do use ssh, but sometimes I am unable to connect so it be nice if I could see the screen. Is there some setting I can change to improve the brightness?

No idea, try the function buttons of the laptop.

just get the ready to use firmware from here

The driver has attached the modem, but the new interface is eth1 not usb0. This sometimes happens.

cdc_ether 2-1:1.0 eth1: register 'cdc_ether' at usb-0000:00:1d.7-1, CDC Ethernet Device, 0c:5b:8f:27:9a:64

Modern modems rarely if ever require usb-modeswitch. In the log you can see that the cdc port is active along with the storage device.

I seem to be getting nowhere so I will try again with a fresh install of OpenWrt 19.07.2 and on boot up run:-

opkg update
opkg install kmod-usb-net-rndis usb-modeswitch

Not realy sure what to do after that. After inserting the USB modem am not sure whether the new interface should be identified as usb0 or eth1 and what do I need to add to /etc/config/network identify this new interface?

I'm assuming I should be using the MegaFon version of the stick and will proceed on this basis.

In /etc/config/network, add a wan section:

config interface 'wan'
   option ifname 'eth1'
   option proto 'dhcp'

A laptop with only one Ethernet port won't have a wan section by default, but the default firewall configuration assumes one will exist and it is set up to forward from lan to wan. So be sure to name your new network exactly 'wan' in lowercase.

For a particular set of hardware and driver the modem interface will always come up either 'usbx' or 'ethx'; it's not going to change.

1 Like

There is obviously something missing, I'm not getting additional interface.

My /etc/config/network:-

config interface 'loopback'
<------>option ifname 'lo'
<------>option proto 'static'
<------>option ipaddr '127.0.0.1'
<------>option netmask '255.0.0.0'

config globals 'globals'
<------>option ula_prefix 'fd51:812a:1187::/48'

config interface 'lan'
<------>option type 'bridge'
<------>option ifname 'eth0'
<------>option proto 'static'
<------>option ipaddr '192.168.1.5'
<------>option netmask '255.255.255.0'
<------>option ip6assign '60'
<------>option gateway '192.168.1.1'
<------>option dns '192.168.1.1'

config interface 'wan'
<------>option ifname 'eth1'
<------>option proto 'dhcp'

Output of ifconfig:-

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:1C:25:B8:CD:38  
          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd51:812a:1187::1/60 Scope:Global
          inet6 addr: fe80::21c:25ff:feb8:cd38/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:579 errors:0 dropped:0 overruns:0 frame:0
          TX packets:237 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:99273 (96.9 KiB)  TX bytes:88736 (86.6 KiB)

eth0      Link encap:Ethernet  HWaddr 00:1C:25:B8:CD:38  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6526 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3756 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4350307 (4.1 MiB)  TX bytes:587568 (573.7 KiB)
          Interrupt:20 Memory:fe000000-fe020000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:138 errors:0 dropped:0 overruns:0 frame:0
          TX packets:138 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13555 (13.2 KiB)  TX bytes:13555 (13.2 KiB)

Something ain't right...

The fact that I advised you to use the NCM protocol and you keep trying different ones.

1 Like

Do you mean these instructions:- ?

https://openwrt.org/docs/guide-user/network/wan/wwan/ethernetoverusb_ncm

Which modem should I use:? I have the HiLink and the Stick version.

Yes, these instructions.
I have the stick version, the 12d1:1506

1 Like

I have it working now. Altough not sure how to organise routing via wwan.

I have my own LAN with a pfSense box at 192.168.1.1 which is currently the Internet gateway as well as DHCP server for the LAN.

What I'm trying to do is set up a system for eventual Internet access via WWAN so not sure how to proceed. I can set up a mini LAN of two systems connected via a seperate hub, but not sure how to configure this in /etc/config/network or do I need to make changes in other files?

Thanks for the invaluable help so far.