Opnsense NDIS support

Started by klontje, March 24, 2020, 05:40:49 PM

Previous topic - Next topic
Hello,

I've spent configuring my new Opnsense router at home and want to add 4G capabilities to it. I have a Huawei E3372h flashed to stick mode and have it working with PPP. PPP mode however does not attain the maximum 4G speed, and NDIS mode is recommended for this. In PFSense (don't want to swear) or other FreeBSD distributions the stick is recognized with the two ports (NDIS and PPP) and after that the NDIS network card is recognized:
Mar 24 16:32:01 pfSense kernel: ugen0.3: <HUAWEIMOBILE HUAWEIMOBILE> at usbus0
Mar 24 16:32:01 pfSense kernel: u3g0 on uhub0
Mar 24 16:32:01 pfSense kernel: u3g0: <HUAWEIMOBILE HUAWEIMOBILE, class 0/0, rev 2.10/1.02, addr 2> on usbus0
Mar 24 16:32:01 pfSense kernel: u3g0: Found 2 ports.
Mar 24 16:32:01 pfSense kernel: cdce0 on uhub0
Mar 24 16:32:01 pfSense kernel: cdce0: <NCM Network Control Model> on usbus0
Mar 24 16:32:01 pfSense kernel: cdce0: faking MAC address
Mar 24 16:32:01 pfSense kernel: ue0: <USB Ethernet> on cdce0
Mar 24 16:32:01 pfSense kernel: ue0: Ethernet address: 2a:d0:7c:ff:7f:00


You can after that initialize it with a single AT string to set the APN:
echo 'AT ^ NDISDUP = 1,1, "live.vodafone.com"' > /dev/cuaU0.1

On Opnsense it seems there are no drivers available for the NDIS modem as the initialization looks like this (it detects the two ports, but no NDIS network card loaded):
Mar 24 16:56:12 OPNsense kernel: ugen0.3: <HUAWEIMOBILE HUAWEIMOBILE> at usbus0
Mar 24 16:56:12 OPNsense kernel: u3g0 on uhub0
Mar 24 16:56:12 OPNsense kernel: u3g0: <HUAWEIMOBILE HUAWEIMOBILE, class 0/0, rev 2.10/1.02, addr 2> on usbus0
Mar 24 16:56:12 OPNsense kernel: u3g0: Found 2 ports.


Would it be possible to include NDIS drivers in Opnsense as well and allow to set an init string for it in the GUI (even without this last part would be amazing as I can set it using a script or something)?

Hello,

This is my first post to the forum. So please bear with me if formatting is wrong.

NDIS seems to be present in in OPNsense  :)

Using OPNsense in VirtualBox and a Huawei E3372h-153 (in Hilink mode) the network interface ue0 is created and I could assign a interface to it.

Kernel log (sorry bottom up)
kernel: da0: quirks=0x2<NO_6_BYTE>
kernel: da0: Attempt to query device size failed: NOT READY, Medium not present
kernel: da0: 40.000MB/s transfers
kernel: da0: <HUAWEI TF CARD Storage 2.31> Removable Direct Access SCSI-2 device
kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
root: Unknown USB device: vendor 0x12d1 product 0x14dc bus uhub1
kernel: umass0:2:0: Attached to scbus2
kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000
kernel: umass0: <Mass Storage> on usbus1
kernel: umass0 on uhub1
kernel: ue0: Ethernet address: 0c:5b:8f:27:9a:64
kernel: ue0: <USB Ethernet> on urndis0
kernel: urndis0: <RNDIS Communications Control> on usbus1
kernel: urndis0 on uhub1
kernel: ugen1.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus1

System information
CPU Type: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (2 cores)
Versions: OPNsense 20.1.4-amd64 / FreeBSD 11.2-RELEASE-p18-HBSD / LibreSSL 3.0.2



Using OPNsense on a PC Engines APU2 and the same E3372h-153 dongle the network interface is not recognised:

Kernel log (sorry bottom up)
kernel: umass0:2:0: Attached to scbus2
kernel: umass0: SCSI over Bulk-Only; quirks = 0x0000
kernel: umass0: <Mass Storage> on usbus0
kernel: umass0 on uhub1
kernel: ugen0.2: <HUAWEIMOBILE HUAWEIMOBILE> at usbus0

System information
CPU Type: AMD GX-412TC SOC (4 cores)
Versions: OPNsense 20.1.2-amd64 / FreeBSD 11.2-RELEASE-p17-HBSD / LibreSSL 3.0.2



Any ideas for the different behaviour?

Thanks in advance for any hints.
mousaka20

PS: I copied the kernel logs from System --> Log Files --> General. How do I change the order, so that oldest messages appear on the top (as in /var/log/messages)?

Try to connect to the modem using command below. Make sure you replace x.x with the port the modem is listening on.
cu /dev/cuaUx.x

and get the mode using
AT^SETPORT?

There might be a different mode set in the device.

May 01, 2020, 10:23:24 AM #3 Last Edit: May 07, 2020, 08:46:13 PM by mousaka20
Thanks klontie  :)

I managed to solve my issue that ue0 did not show up on the APU setup.
Solution: Set the E3372h to "Work Mode (CDC, not for Windows)"; so your hint using a different mode was key.

My current working setup in all little more details, hopefully useful for others. At least it took me quiet some time to figure it out:

  • Upgrade E3372h-153 to custom WebUI and firmware, using the needle method

    • Firmware E3372h-153_Update_22.333.01.00.00_M_AT_05.10
    • WebUI WEBUI_17.100.18.03.143_HILINK_Mod1.21
  • In WebUI: Settings --> System --> Modification Settings: Set Autoswitch to Word Mode (CDC, not for Windows) Note: I did this on my Windows 10 computer
  • Connect E3372h-153 to APU2 running OPNsense
  • Assign WAN interface to ue0; no cuaU0 available; ue0 should receive IPv4 192.168.8.100 via DHCP
  • In WebUI (192.168.8.1) define APN: Settings --> Dial-Up --> Profile Management; use value given by your ISP
  • In WebUI define DMZ: Settings --> Security --> DMZ Settings: Enable for IP 192.168.8.100 (OPNsense router)

So my E3372h-153 is running in HiLink-Mode, therefore the WebUI of the stick is available providing some additional information like LTE signal strength  :)