I'm trying to get multi-WAN capability working between an ethernet interface & a cellular interface with IPv4 & IPv6.
There's a conflict between the way that mwan3 wants the cellular interface in uci network config & the way ModemManager creates the interface that I haven't been able to work around.
In order to manage IPv4 & IPv6, mwan3 wants 2 interfaces for a physical interface, 1 w/ IPv4 addressing & 1 w/ IPv6 addressing. But when I create separate interfaces for IPv4 & IPv6 w/ protocol ModemManager, the interface is unusable. The LuCi Interfaces page reports "Error: Network device is not present" when it is clearly present, as evidenced by running 'mmcli -m 0'. Note that if I configure IPv4 & IPv6 on a single interface w/ ModemManager, they both come up & work.
I've tried using the QMI protocol in LuCi, but that presents another issue in that 2 interfaces are created, but the IPv4 interface is uneditable, & thus the gateway metric can't be set, which mwan3 requires.
Has anyone gotten this multi-WAN scenario working?
I'm using an LTE USB dongle w/ a Quectel EG25-G modem on OpenWRT version 22.03.0
Have you tried to use a single interface for v4 and v6 in mwan3? I know it is against the documentation, I just cannot think of anything else right now.
I don't think the mwan3 config supports v4 & v6 on a single interface. In the LuCi config page, the pulldown menu for 'Internet Protocol' has either v4 or v6, not both.
Right, but if you create one interface for v4 and another for v6 will mwan3 complain?
Do you mean to create 2 interfaces in the Network / Interfaces LuCi page, 1 for v4 & 1 for v6? That's the config I described in the initial post. And then the interface doesn't come up, perhaps because there are 2 ModemManager instances competing?
In mwan3, something like this:
config interface 'wan'
option enabled '1'
list track_ip '1.0.0.1'
list track_ip '1.1.1.1'
list track_ip '208.67.222.222'
list track_ip '208.67.220.220'
option family 'ipv4'
config interface 'wan'
option enabled '1'
list track_ip '2001:4860:4860::8844'
list track_ip '2001:4860:4860::8888'
list track_ip '2606:4700:4700::1111'
list track_ip '2606:4700:4700::1001'
option family 'ipv6'
That config doesn't work. On the LuCi mwan3 Network / MultiWAN Manager config page, it says "Names must match the interface name found in /etc/config/network". So I went to busybox & directly edited /etc/config/mwan3 & restarted it. But on the LuCi Status / MultiWAN page & LuCi Network / MultiWAN page, only 1 wwan interface is shown. Clicking edit reveals that it's the ipv6 entry, indicating mwan3 takes the last interface config for a particular named interface.
Then maybe @aaronjg @feckert can have a look.
Works for me with Huawei E3372h reflashed to stick firmware and NCM.
The key here is that in OpenWrt, even though there is only one physical interface, separate logical interfaces are created for IPv4 and IPv6. In many cases (e.g. by default with NCM), the IPv6 interface is auto-created.
Here is my /etc/config/network
fragment:
config interface 'lte'
option proto 'ncm'
option pdptype 'IPV4V6'
option ipv6 'auto'
option peerdns '0'
option metric '90'
option apn 'internet'
option username 'lte'
option password 'lte'
option delay '5'
option device '/dev/ttyUSB1'
option mode 'preferlte'
list dns '9.9.9.9'
list dns '2620:fe::fe'
list dns '149.112.112.112'
list dns '2620:fe::9'
Here is the resulting interface status:
As a result, I am able to use lte_4
and lte_6
interfaces in mwan3 configuration. Yes, I ignore the "Names must match the interface name found in /etc/config/network" prescription, because what really matters is that ifstatus
knows about them.
If you can't separate the two interfaces logically, just create an alias.
1 Like
That configuration is promising. I've got the 2 virtual interfaces created but still have to configure the multi-WAN.
I'll post again after I get the multi-WAN config going.
BTW, sorry for the late response - I was on vacation.
I added 2 alias interfaces, wwan_4 & wwan_6. But they don't come up & there is no default route added for wwan.
@patrakov, how did you get the Protocol set to 'Virtual dynamic interface'?
Here's my route table:
root@rg:~# ip r
192.168.1.0/24 dev br-lan proto kernel scope link src 192.168.1.254
Here's my /etc/config/network snippet:
config interface 'wwan_4'
option proto 'dhcp'
option device 'wwan0'
option metric '30'
option macaddr 'A0:68:7E:F7:26:F5'
config interface 'wwan_6'
option proto 'dhcpv6'
option device 'wwan0'
option reqaddress 'try'
option reqprefix 'auto'
option metric '40'
option macaddr 'A0:68:7E:F7:26:F6'
config interface 'wwan'
option proto 'modemmanager'
option device '/sys/devices/platform/800c0000.usb0_xhci/xhci-hcd.0/usb1/1-1'
option auth 'none'
option iptype 'ipv4v6'
option macaddr 'A0:68:7E:F7:26:F7'
Here's my interface status:
Virtual dynamic interfaces are created automatically by some protocols (in my case, NCM) and have exactly zero config lines corresponding to them.
Regarding your config, I have looked at what ModemManager offers, and it is apparently not possible to split IPv4 and IPv6 cleanly, because there are simply no options for this.
Suggestions to be investigated as alternatives:
-
Delete wwan_4. Define wwan6 (note: not wwan_6) as an unmanaged interface (not dhcpv6!) which aliases to wwan (option device @wwan
, note the @). Ignore the fact that the IPv6 address belongs to wwan, not to wwan6, according to Luci. Try to use wwan and wwan6 in mwan3.
-
Drop ModemManager. Figure out which actual protocol (MBIM, QMI, NCM) it uses to set up your modem, and install the corresponding protocol package (luci-proto-mbim
and so on). Reboot the router, reconfigure the modem, and these virtual dynamic interfaces will appear by themselves.
1 Like
I use qmi protocol with my quectel modem.
it creates two virtual interfaces and adds _4 or _6 to the name of the interface in my case it is named Wwan, I just configure mwan3 as below and it all seems to work, (be aware myfail over is currently disabled (out of credit).
config globals 'globals'
option mmx_mask '0x3F00'
list rt_table_lookup '220'
config interface 'Wan'
option enabled '1'
list track_ip '8.8.4.4'
list track_ip '8.8.8.8'
list track_ip '208.67.222.222'
list track_ip '208.67.220.220'
option family 'ipv4'
option reliability '1'
config interface 'Wan6'
option enabled '0'
list track_ip '2001:4860:4860::8844'
list track_ip '2001:4860:4860::8888'
list track_ip '2620:0:ccd::2'
list track_ip '2620:0:ccc::2'
option family 'ipv6'
option reliability '1'
config interface 'Wwan_4'
option enabled '1'
list track_ip '8.8.4.4'
list track_ip '8.8.8.8'
list track_ip '208.67.222.222'
list track_ip '208.67.220.220'
option family 'ipv4'
option reliability '1'
config interface 'Wwan_6'
option enabled '1'
list track_ip '2001:4860:4860::8844'
list track_ip '2001:4860:4860::8888'
list track_ip '2620:0:ccd::2'
list track_ip '2620:0:ccc::2'
option family 'ipv6'
option reliability '1'
config member 'Wan_m1_w3'
option interface 'Wan'
option metric '1'
option weight '3'
config member 'Wan_m2_w3'
option interface 'Wan'
option metric '2'
option weight '3'
config member 'Wwan_4_m1_w2'
option interface 'Wwan_4'
option metric '1'
option weight '2'
config member 'Wwan_4_m2_w2'
option interface 'Wwan_4'
option metric '2'
option weight '2'
config member 'Wan6_m1_w3'
option interface 'Wan6'
option metric '1'
option weight '3'
config member 'Wan6_m2_w3'
option interface 'Wan6'
option metric '2'
option weight '3'
config member 'Wwan_6_m1_w2'
option interface 'Wwan_6'
option metric '1'
option weight '2'
config member 'Wwan_6_m2_w2'
option interface 'Wwan_6'
option metric '2'
option weight '2'
config policy 'Wan_only'
list use_member 'Wan_m1_w3'
list use_member 'Wan6_m1_w3'
config policy 'Wwan_only'
list use_member 'Wwan_4_m1_w2'
list use_member 'Wwan_6_m1_w2'
config policy 'balanced'
list use_member 'Wan_m1_w3'
list use_member 'Wwan_4_m1_w2'
list use_member 'Wan6_m1_w3'
list use_member 'Wwan_6_m1_w2'
config policy 'Wan_Wwan'
list use_member 'Wan_m1_w3'
list use_member 'Wwan_4_m2_w2'
list use_member 'Wan6_m1_w3'
list use_member 'Wwan_6_m2_w2'
config policy 'Wwan_Wan'
list use_member 'Wan_m2_w3'
list use_member 'Wwan_4_m1_w2'
list use_member 'Wan6_m2_w3'
list use_member 'Wwan_6_m1_w2'
config rule 'https'
option sticky '1'
option dest_port '443'
option proto 'tcp'
option use_policy 'Wan_only'
config rule 'default_rule_v4'
option dest_ip '0.0.0.0/0'
option family 'ipv4'
option proto 'all'
option sticky '0'
option use_policy 'Wan_only'
config rule 'default_rule_v6'
option dest_ip '::/0'
option family 'ipv6'
option proto 'all'
option sticky '0'
option use_policy 'Wan_only'
I think you can set a metric in the network config for virtual created interfaces but never tried it my self mwan3 does say no metric under the interfaces option in the LTE wireless interfaces but it still seems to work for me:
config route 'Wwan_4_route'
option interface 'Wwan_4'
option target '0.0.0.0'
option gateway '10.64.64.64'
option netmask '0.0.0.0'
option metric '50'
I have gotten this working using QMI protocol as suggested by @professor_jonny. I still need to verify IPv6 failover. I will post more details soon, but didn't want this thread to auto-close.
1 Like
There's no default route for the cellular interface. mwan3 detects this, as shown by the 'mwan3 status' command:
interface wwan_4 is online 00h:37m:22s, uptime 02h:29m:40s and tracking is active
interface wwan is error (16) and tracking is active
Error 16 indicates no default route.
Note that wwan is the IPv6 interface & wwan_4 is the IPv4 auto-generated virtual dynamic interface.
The interface status from LuCi looks good:
Is QMI Protocol supposed to automatically add an IPv6 default route?
You should get a virtual interface wwan_6 yours is different to mine.
I'm prity sure I have Wwan as setup in the network menu for qmi and I get Wwan_4 for the ipv4 interface and Wwan_6 for the ipv6 interface
Of note if you just copied my mwan3 config file notice the case of the Wwan it would track the wrong interface name.
I get the green and yellow boxes when they are on and offline in the tracking overview it all works.
All my config files are here if you wanna look at them of note ipv6 is disabled for both Wan and Wwan at the time i was having issues with the branding switch from vodafone nz to one nz and a change of apn:
pj_openwrt/files/etc/config at master · professor-jonny/pj_openwrt · GitHub