I have ZTE MF286R, flashed Openwrt 23.05 instead of original ZTE firmware and spent some time to get this modem work as LTE BRIDGE. Personally I didn't like ZTE firmware regarding the LTE Bridge mode, it's slow, clumsy, no flexibility, so decide to go with Openwrt. I did this on Openwrt firmware from eko.one.pl but the stock Openwrt should work as well. The biggest problem is as mentioned in other threads that this ncm modem is not fully L2 compliant and modem does not work in bridge mode out of box.
Want to share my setup here, on how to get Openwrt working as lte bridge, step by step. Please notice this is high level howto and you must have knowledge of what you're doing. I won't go into setup details as I did this month ago and I don't want to kill my setup redoing it again for the device which is already hardly accessible on the roof.
-
Setup modem working as a LTE router, so you have a stable LTE NAT router configuration on Openwrt.
-
My Openwrt config has wifi disabled, bridge interface does not have an IP address set, so you will loose access to your Openwrt device. If you do not have a console soldered and connected then I recommend to create management vlan over ethernet, or setup a wifi AP with side network as a temporary access, or any other way you like. I use management vlan over LAN/WAN port to access the device and allow it to access internet for updates.
-
There must be a comgt-ncm package already installed. You need to edit ncm script from this package to make sure that Openwrt does intercept DHCP IP address provided by the LTE modem to itself, but pass it through the bridge to your router. Edit file /lib/netifd/proto/ncm.sh and change the 2 following lines (diff format):
@@ -187,7 +187,7 @@
json_init
json_add_string name "${interface}_4"
json_add_string ifname "@$interface"
- json_add_string proto "dhcp"
+ json_add_string proto "none"
proto_add_dynamic_defaults
[ -n "$zone" ] && {
json_add_string zone "$zone"
@@ -200,7 +200,7 @@
json_init
json_add_string name "${interface}_6"
json_add_string ifname "@$interface"
- json_add_string proto "dhcpv6"
+ json_add_string proto "none"
json_add_string extendprefix 1
proto_add_dynamic_defaults
[ -n "$zone" ] && {
- Another problem to overcome is that NCM modem does not work properly in Openwrt bridge and all outgoing packets from modem interface have destination mac address set to Openwrt usb interface instead of actual sender. Normally for the bridge mode you would use setup like (Your LAN)---cable--(Your LAN router)--cable--(ZTE Openwrt Bridge)--LteNetwork, this means there can only 1 device behind the LTE bridge, which is your Router. You need to lookup your Router's MAC address of the interface which points to the Openwrt/LTE. Edit file /etc/rc.local and append the following lines at the end, before the "exit 0" and replace "74:55:44:33:22:11" wit your Router's MAC address:
# DSTNAT outgoing packets because modem addresses only usb1 interface by default
nft add table bridge nat
nft add chain bridge nat mydnat
nft add chain bridge nat prerouting '{ type filter hook prerouting priority -300; policy accept; }'
nft add rule bridge nat prerouting iifname usb1 jump mydnat
nft add rule bridge nat mydnat ether daddr set 74:55:44:33:22:11
Here "usb1" is the NCM modem interface on Opewrt and "74:55:44:33:22:11" is my mikrotik router behind the ZTE device. I know it's hardcode, but in my case I'm sure my mikrotik will last another decade.
If above nft commands fail, you need to add missing Openwrt packages.
- Create an unmanaged bridge device on Openwrt and bridge ports eth0.1 (ethernet) and usb1 (ncm modem). My config excerpt:
config interface 'lte'
option proto 'ncm'
option device '/dev/ttyACM0'
option pdptype 'IPV4V6'
option apn 'internet'
config device
option name 'eth0.1'
option type '8021q'
option ifname 'eth0'
option vid '1'
option macaddr 'C8:EA:F8:D7:72:19'
config device
option type 'bridge'
option name 'wan'
list ports 'eth0.1'
list ports 'usb1'
option bridge_empty '1'
option ipv6 '0'
config interface 'wan'
option proto 'none'
option device 'wan'
option force_link '1'
option delegate '0'
I wish modifications from steps 3 and 4 gets integrated properly into ncm package and firmware like the one from eko.one.pl. Btw MF286r LTE modem with the latest firmware update from 2023 is working very stable with Openwrt and there are no unexpected connection drops like frequently mentioned in this forum.
If you have any questions please ask.