Exposing a bridge from an MBIM interface to map to VM

jimwas

New Member
Jan 14, 2021
3
0
1
37
Hi there,

I have a 4G/LTE usb dongle, a Huawei E3372s-153, that has been absolutely driving me up the wall that I want to use as a failover device for a pfSense VM I am running within my Proxmox host. I've had less than no luck passing it directly to the VM, but after HOURS of trying various different ways of connecting it and mode switching, I've finally managed to get it so that it is at least connected and working as an MBIM device on the Proxmox host itself.

What I would like to do is somehow create a bridge that I can assign to the pfSense VM so that it can assign it as an interface and use it as part of a failover grouping. I understand how to create bridges and associated them with interfaces but unfortunately, I think due to the dodgy way the device "fakes" being an ethernet device, as soon as you attach it to a bridge, both it and the bridge stop working and the device isn't capable of a true/traditional linux bridge.

I've tried to follow countless articles on various ways of routing data to this device in a way that I could then expose to the VM but due to my basic knowledge of networking, I haven't managed to get any to succeed. Most articles I have followed have been concerning bridging WLAN rather than an MBIM sourced connection to another physical interface and I think this is where I am falling over. I essentially need a bridge that somehow auto routes any traffic to it through the MBIM interface. Hopefully that makes sense! I would be beyond grateful for any help as I have no wasted 10s of hours trying to get this thing to work and am starting to go slightly insane!

Here is my current interfaces setup:

Bash:
auto lo
iface lo inet loopback

# main ethernet
allow-hotplug enp0s31f6
iface enp0s31f6 inet manual

# mbim interface for huawei 4g modem
iface wwp0s20f0u12c2 inet manual

# vlan 10 interface for accessing proxmox web ui
auto vmbr0.10
iface vmbr0.10 inet static
address 192.168.1.101/24
gateway 192.168.1.1

# main bridge to pass through to pfsense vm
auto vmbr0
iface vmbr0 inet manual
bridge-ports enp0s31f6
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes

Here is the ifconfig for the MBIM:

Bash:
wwp0s20f0u12c2: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet xx.xx.xx.54  netmask 255.255.255.252  broadcast xx.xx.xx.55
        inet6 xxxx::xxxx:xxxx:xxxx:8935  prefixlen 64  scopeid 0x20<link>
        ether 9e:de:18:5e:89:35  txqueuelen 1000  (Ethernet)
        RX packets 212  bytes 40420 (39.4 KiB)
        RX errors 788  dropped 0  overruns 0  frame 0
        TX packets 362  bytes 35444 (34.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And here it is allowing me to successfully grab the public ip:

Bash:
curl --interface wwp0s20f0u12c2 http://checkip.dyndns.com/
<html><head><title>Current IP Check</title></head><body>Current IP Address: xxx.xxx.xxx.238</body></html>

Even the simplest, worst advised thing that could make this work would be amazing, it's just a hobby box really!
Thanks so much!
 
And this does not work?
Bash:
auto lo
iface lo inet loopback

# main ethernet
allow-hotplug enp0s31f6
iface enp0s31f6 inet manual

# mbim interface for huawei 4g modem
auto wwp0s20f0u12c2
iface wwp0s20f0u12c2 inet manual

# vlan 10 interface for accessing proxmox web ui
auto vmbr0.10
iface vmbr0.10 inet static
address 192.168.1.101/24
gateway 192.168.1.1

# main bridge to pass through to pfsense vm
auto vmbr0
iface vmbr0 inet manual
bridge-ports enp0s31f6
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes

auto vmbr1
iface vmbr1 inet static
address xxx.yyy.aaa.bbb
netmask 255.255.255.0
bridge-ports wwp0s20f0u12c2
bridge-stp off
bridge-fd 0
What exactly stops working if you define that?
 
And this does not work?
Bash:
auto lo
iface lo inet loopback

# main ethernet
allow-hotplug enp0s31f6
iface enp0s31f6 inet manual

# mbim interface for huawei 4g modem
auto wwp0s20f0u12c2
iface wwp0s20f0u12c2 inet manual

# vlan 10 interface for accessing proxmox web ui
auto vmbr0.10
iface vmbr0.10 inet static
address 192.168.1.101/24
gateway 192.168.1.1

# main bridge to pass through to pfsense vm
auto vmbr0
iface vmbr0 inet manual
bridge-ports enp0s31f6
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes

auto vmbr1
iface vmbr1 inet static
address xxx.yyy.aaa.bbb
netmask 255.255.255.0
bridge-ports wwp0s20f0u12c2
bridge-stp off
bridge-fd 0
What exactly stops working if you define that?
Thanks for your reply!

Everything stops working essentially, as soon as you bring up vmbr1 you can't ping/curl on the bridge interface or the underlying wwan interface. If you then take the bridge back down everything still just times out and it doesn't seem to work again until you reset the MBIM connection.

From advice I read in other places, and apologies if my terminology is wrong here, the ethernet device that these dongles often present is a bit duff and don't really properly implement the required stuff for real layer 2 bridging. There is some information on that here:

https://lists.freedesktop.org/archives/libmbim-devel/2014-October/000392.html

and

https://forum.openwrt.org/t/bridge-mode-lte-usb-modem/35974/5

the tldr being:

"This usually won't work. The wwan0 interface is not an ethernet interface, even if it might appear like one in some cases. That's an illusion created by the modem firmware and/or driver. But the illusion is not perfect and does not necessarily support clients with a mac address different from the fake wwan0 one."

unfortunately I don't understand enough about the suggested alternatives to get anything else to work so far!

Thanks again.
 
do you have tried to do simple usb passthrough in your pfsense vm ?

(if you don't need to shared it with multiple vms)
I am trying to avoid passing it through as FreeBSD doesn't seem to support mbim, or at least doesn't have a version of the mbimcli and that is the only way I've managed to get the dongle to connect.

PPP, sending AT commands over cu etc, none have worked. Having finally found one way of getting it to connect after 10s of hours of failures, I was kind of hoping I could find some magic way of linking it through to the VM as is, but if that's not possible I might just give up!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!