rain4G double NAT bypass and/or tunnel

I previously posted this request regarding conditional DHCP, which was solved by @trendy and @vgaetera. This is the next problem I am facing.

I have been experimenting with an OpenWRT-RPi+e3772h-320 USB stick 4G/LTE link.

The e3772h-320 model is unfortunately double NAT'd. It has the following

Hardware version CL4E3372HM
Software version 10.0.3.1(H192SP2C983)
Web UI version WEBUI 10.0.3.1(W13SP1C7601)
Configuration file version E3372h-320-CUST 10.0.3.2(C1232)

I assume HM is hilink mode. I cannot get the usbmode adjustments to work as they seem to apply to e3772h-153 or e3772h-607 which AFAIK, use the balong chipset (typically CL2E3372HM) and firmware versions for those are 21.x.x(stick) 22.x.x(hilink). The 10.x.x software/webui version also indicate a completely different structure/chipset, but I am not sure.

  • If anyone has managed to adjust or reflash this model/firmware to stick mode, I would love to know how....anyway...

The modem and the APN is set at modem level and is configured via its internal 192.168.8.1 address while the device is plugged in to a PC. The modem's internal DHCP issues an address to WAN of 192.168.8.1xx.

To get the system working, I followed the rndis option from here and it is now working - the modem establishes the connection internally, and then eth1 becomes WAN.

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

The 4G is working and the speed is much better than previously possible.

I can see the WAN ip of 197.xxx.yyy.196 from dig +short myip.opendns.com @resolver1.opendns.com, but I cannot access this from outside the LAN.

I can, if needed, create a DDNS that will be updated every few minutes to this external IP.

The problem appears to be with/at the ISP - I want to do some port forwards and a VPN, but I'm told " that is not possible as rain does not assign public IPs to devices on their network"????

  • Will it work to create an SSH tunnel from inside the LAN to a remote WAN device, and then use that tunnel to create a route back in for traffic?
    • and if so, how?
  • Could the tunnel also be used to set up a wireguard site2site VPN.
  • Is there another way around this that a novice/n00b of my level could look at or try (with examples please)?
  • If the modem can be adjusted from hilink to stick mode, would this change the scenario much?
    • might it be possible to open ports at modem(192.168.8.1) level to achieve the same result?

Thanks

Yes, I had done it in the past with the help from autossh

You can use wireguard exclusively for that.

1 Like

Please unload usb-storage driver with rmmod usb-storage.ko, re-plug the modem and show your log.

You can use wireguard exclusively for that.

I am not sure if you mean within the tunnel?
AFAIK (which is not much) I can't get wireguard to work as is - I can't get into the WAN IP from outside at all. That implies that the WG would be inside a tunnel, but I don't actually know.

I will try doing what @AndrewZ suggests as well, and post results here too if that's OK (I know it's technically off-topic, but this is a follow-on post so it might not violate the forum rules)

In any case you need one end of the tunnel with routable/reachable IP. Either you'll configure the 4G router or some VPS on a cloud service.

In any case you need one end of the tunnel with routable/reachable IP

OMG! - how do you set it up with only one trackable IP? Is there an example of this I can look at?

Here for OpenWrt as server or you can search for RoadWarrior examples. In the second case OpenWrt will be the client.

1 Like

had this in my notes for 3372*153

try on linux pc (fallback mode):

vim /etc/usb_modeswitch.conf

DisableSwitching=1

HuaweiAltModeGlobal=1

usb_modeswitch -v 0x12d1 -p 0x1f01 -n -I -M 55534243123456780000000000000011063000000100010000000000000000

or

AT ^ NVWREX = 50091,0,60,1 0 0 0 FF 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 12 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

equals to AT^SETPORT="FF;10,12,16"

The modem doesn't show up in /dev no matter what I try?

root@OpenWrt:~# rmmod usb-storage.ko
module is not loaded

root@OpenWrt:~# dmesg | grep usb
[46821.472841] usb 1-1.1: USB disconnect, device number 3
[46821.489936] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet
[46821.711399] usb 1-1.2: USB disconnect, device number 5
[46821.719261] cdc_ether 1-1.2:1.0 eth1: unregister 'cdc_ether' usb-3f980000.usb-1.2, CDC Ethernet Device
[46822.139340] usb 1-1: reset high-speed USB device number 2 using dwc_otg
[46822.729251] usb 1-1.1: new high-speed USB device number 6 using dwc_otg
[46822.879570] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[46822.888796] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[46822.993898] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ab:86:a1
[46838.029332] usb 1-1.2: new high-speed USB device number 7 using dwc_otg
[46838.170585] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1f01
[46838.179528] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[46838.188825] usb 1-1.2: Product: HUAWEI_MOBILE
[46838.195080] usb 1-1.2: Manufacturer: HUAWEI_MOBILE
[46838.201753] usb 1-1.2: SerialNumber: 0123456789ABCDEF
[46838.209840] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[46838.218521] scsi host0: usb-storage 1-1.2:1.0
[46838.503553] usb 1-1.2: USB disconnect, device number 7
[46838.909339] usb 1-1.2: new high-speed USB device number 8 using dwc_otg
[46839.050389] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=14db
[46839.059081] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[46839.068205] usb 1-1.2: Product: HUAWEI_MOBILE
[46839.074325] usb 1-1.2: Manufacturer: HUAWEI_MOBILE
[46839.159884] cdc_ether 1-1.2:1.0 eth1: register 'cdc_ether' at usb-3f980000.usb-1.2, CDC Ethernet Device, 00:1e:10:1f:00:00

root@OpenWrt:~# ls /dev
adsp                loop4               ram12               tty10               tty28               tty45               tty62
audio               loop5               ram13               tty11               tty29               tty46               tty63
bus                 loop6               ram14               tty12               tty3                tty47               tty7
console             loop7               ram15               tty13               tty30               tty48               tty8
cpu_dma_latency     memory_bandwidth    ram2                tty14               tty31               tty49               tty9
dsp                 mixer               ram3                tty15               tty32               tty5                ttyAMA0
fb0                 mmcblk0             ram4                tty16               tty33               tty50               ttyS0
full                mmcblk0p1           ram5                tty17               tty34               tty51               urandom
gpiochip0           mmcblk0p2           ram6                tty18               tty35               tty52               vc-mem
gpiochip1           network_latency     ram7                tty19               tty36               tty53               vchiq
gpiochip2           network_throughput  ram8                tty2                tty37               tty54               vcs
input               null                ram9                tty20               tty38               tty55               vcs1
kmsg                ppp                 random              tty21               tty39               tty56               vcsa
log                 ptmx                raw                 tty22               tty4                tty57               vcsa1
loop-control        pts                 shm                 tty23               tty40               tty58               watchdog
loop0               ram0                snd                 tty24               tty41               tty59               watchdog0
loop1               ram1                tty                 tty25               tty42               tty6                zero
loop2               ram10               tty0                tty26               tty43               tty60
loop3               ram11               tty1                tty27               tty44               tty61

root@OpenWrt:~# lsusb -v -d 12d1:14db

Bus 001 Device 008: ID 12d1:14db Huawei Technologies Co., Ltd. E353/E3131
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x12d1 Huawei Technologies Co., Ltd.
  idProduct          0x14db E353/E3131
  bcdDevice            1.02
  iManufacturer           1 HUAWEI_MOBILE
  iProduct                2 HUAWEI_MOBILE
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           88
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower                2mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       6 Ethernet Networking
      bFunctionProtocol       0 
      iFunction               8 CDC ECM
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      6 Ethernet Networking
      bInterfaceProtocol      0 
      iInterface              5 CDC Ethernet Control Model (ECM)
      CDC Header:
        bcdCDC               1.10
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC Ethernet:
        iMacAddress                      7 001E101F0000
        bmEthernetStatistics    0x00000000
        wMaxSegmentSize               1514
        wNumberMCFilters            0x0000
        bNumberPowerFilters              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               5
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              6 CDC Ethernet Data
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

The goal is to avoid this.
Try to rename usb-storage.ko found in /lib/modules/{kernel version}/ and reboot without modem plugged in. Once the system is booted insert the modem and post the log starting from the moment the modem was plugged in.

Edit: rename will not work, sorry - I have ext4 filesystem used in my test router, so with squashfs everything will be different

1 Like

I don't seem to have that file?

root@OpenWrt:/lib/modules/4.14.180# ls
brcmfmac.ko                ip_set_hash_ip.ko          nf_conntrack_ipv6.ko       ohci-hcd.ko                usbhid.ko
brcmutil.ko                ip_set_hash_ipmark.ko      nf_conntrack_netlink.ko    ohci-platform.ko           vfat.ko
cdc_ether.ko               ip_set_hash_ipport.ko      nf_conntrack_rtcache.ko    ppp_async.ko               x_tables.ko
cfg80211.ko                ip_set_hash_ipportip.ko    nf_defrag_ipv4.ko          ppp_generic.ko             xt_CT.ko
compat.ko                  ip_set_hash_ipportnet.ko   nf_defrag_ipv6.ko          pppoe.ko                   xt_FLOWOFFLOAD.ko
crc-ccitt.ko               ip_set_hash_mac.ko         nf_flow_table.ko           pppox.ko                   xt_LOG.ko
ehci-hcd.ko                ip_set_hash_net.ko         nf_flow_table_hw.ko        rndis_host.ko              xt_REDIRECT.ko
ehci-platform.ko           ip_set_hash_netiface.ko    nf_log_common.ko           slhc.ko                    xt_TCPMSS.ko
evdev.ko                   ip_set_hash_netnet.ko      nf_log_ipv4.ko             snd-bcm2835.ko             xt_comment.ko
fat.ko                     ip_set_hash_netport.ko     nf_log_ipv6.ko             snd-compress.ko            xt_conntrack.ko
hid-generic.ko             ip_set_hash_netportnet.ko  nf_nat.ko                  snd-hwdep.ko               xt_limit.ko
hid.ko                     ip_set_list_set.ko         nf_nat_ipv4.ko             snd-mixer-oss.ko           xt_mac.ko
ip6_tables.ko              ip_tables.ko               nf_nat_masquerade_ipv4.ko  snd-pcm-dmaengine.ko       xt_mark.ko
ip6t_REJECT.ko             ipt_MASQUERADE.ko          nf_nat_redirect.ko         snd-pcm-oss.ko             xt_multiport.ko
ip6table_filter.ko         ipt_REJECT.ko              nf_reject_ipv4.ko          snd-pcm.ko                 xt_nat.ko
ip6table_mangle.ko         iptable_filter.ko          nf_reject_ipv6.ko          snd-rawmidi.ko             xt_set.ko
ip_set.ko                  iptable_mangle.ko          nfnetlink.ko               snd-seq-device.ko          xt_state.ko
ip_set_bitmap_ip.ko        iptable_nat.ko             nls_cp437.ko               snd-timer.ko               xt_tcpudp.ko
ip_set_bitmap_ipmac.ko     nf_conntrack.ko            nls_iso8859-1.ko           snd.ko                     xt_time.ko
ip_set_bitmap_port.ko      nf_conntrack_ipv4.ko       nls_utf8.ko                soundcore.ko

what about /etc/modules.d/usb-storage ?

root@OpenWrt:~# ls /etc/modules.d/usb-storage
ls: /etc/modules.d/usb-storage: No such file or directory

root@OpenWrt:~# ls /etc/modules.d/
15-mii                68-sound-arm-bcm2835  nf-ipt
20-usb-core           brcmfmac              nf-ipt6
25-nls-cp437          brcmutil              nf-nat
25-nls-iso8859-1      hid-generic           nf-reject
25-nls-utf8           ipt-conntrack         nf-reject6
30-fs-vfat            ipt-core              nfnetlink
30-sound-core         ipt-nat               ppp
35-usb-ehci           ipt-offload           pppoe
40-usb2               lib-crc-ccitt         usb-hid
42-ip6tables          mmc                   usb-net
49-ipt-ipset          nf-conntrack          usb-net-cdc-ether
50-usb-ohci           nf-conntrack-netlink  usb-net-rndis
60-input-evdev        nf-conntrack6
61-hid                nf-flow

root@OpenWrt:~# lsusb
Bus 001 Device 008: ID 12d1:14db Huawei Technologies Co., Ltd. E353/E3131
Bus 001 Device 006: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@OpenWrt:~# lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 6, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 8, If 1, Class=CDC Data, Driver=cdc_ether, 480M
        |__ Port 2: Dev 8, If 0, Class=Communications, Driver=cdc_ether, 480M

Then I can only suggest to try another image where this module in not present or could be easily unloaded/disabled. As always I recommend this OpenWrt based image for its great modem support.

Thank you Andrew. i will try it out and give you some feedback. A quick question....does the firmware include all the usual utilities (I specifically need wireguard)?

No wireguard there. Anyway, that is just a test.

What you can try with the current image:
echo "12d1 1f01" > /sys/bus/usb/drivers/usb-storage/remove_id

Then plug your modem in.

1 Like
[171740.135875] usb 1-1.2: USB disconnect, device number 8
[171740.143172] cdc_ether 1-1.2:1.0 eth1: unregister 'cdc_ether' usb-3f980000.usb-1.2, CDC Ethernet Device
[171761.422902] usb 1-1.2: new high-speed USB device number 9 using dwc_otg
[171761.554139] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1f01
[171761.563054] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[171761.574095] usb 1-1.2: Product: HUAWEI_MOBILE
[171761.580429] usb 1-1.2: Manufacturer: HUAWEI_MOBILE
[171761.587217] usb 1-1.2: SerialNumber: 0123456789ABCDEF
[171761.595319] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[171761.604150] scsi host0: usb-storage 1-1.2:1.0
[171761.895919] usb 1-1.2: USB disconnect, device number 9
[171762.352916] usb 1-1.2: new high-speed USB device number 10 using dwc_otg
[171762.483953] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=14db
[171762.492900] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[171762.503994] usb 1-1.2: Product: HUAWEI_MOBILE
[171762.510264] usb 1-1.2: Manufacturer: HUAWEI_MOBILE
[171762.595793] cdc_ether 1-1.2:1.0 eth1: register 'cdc_ether' at usb-3f980000.usb-1.2, CDC Ethernet Device, 00:1e:10:1f:00:00
[171762.597421] cdc_ether 1-1.2:1.0 eth1: kevent 12 may have been dropped
[171762.619861] cdc_ether 1-1.2:1.0 eth1: kevent 11 may have been dropped

Can I PM you (I have fired up a spare PC using r00ter - but that obviously won't be supported here)

You can always ask a question at their forum. Yes, I can try to answer some of your questions via PM.