2 Gbps WAN/LAN NAT Routing on ramips MT7621 devices

phy0 is assigned to gmac1 and phy4 to gmac0. What's the issue?

I use ubnt erx 's eth4 as wan port. In this case,Can eth4 benefit from this patch?Thanks.

I mean...you can edit the dts

or something similar to the other choices on this same FW page, a drop list:


Texte: Flow offloading

  • choice 1: Off/disable/No thanks ...
  • choice 2: Software
  • choice 3: Hardware

Hello arinc9,

Quick question, does the current 22.03.0 stable release include your patch(s) as well?
I tried reading the posted changelog but the bleepin' commit diff? is not in any alphabetical or numerical order. Unless there is some trick to it that I'm missing ...


Other than the patch for GB-PC, they are not on 22.03.

1 Like

Thanks for the reply.
Will stick with your release (saved previously) or snapshots. :slight_smile:

After a week of testing I've just taken the plunge and migrated my entire home/office network to this, including two separate telecommute/VPN users on gigabit fiber and 4 separate VLANs.

It's working spectacularly; total bandwidth and responsiveness are impressive; basically ~930mbps WAN:LAN(s), all you can expect with PPPoE -- and pretty nearly that bidirectionally -- and there's almost never any measurable CPU load.

The only negative result of moving away from a quad-NIC x86_64 solution is that now I only get a total 1Gb/s (aka "500/500" as noted above) bandwidth when routing internally between VLANs. But that's never going to be a problem in real life: my network design is such that it's very unusual to need to move large files between VLANs: everything with a disk drive sits on a single VLAN, the rest are either simple devices (e.g. IoT) and lightweight streamers on the one hand, or fully-isolated paths for VPN tunnels terminated on other devices on the other. The MT7621 in this scenario is all network appliance and no application.

Even DNS is handled by a separate device; I've connected up an old $5 Pi Zero to the router's USB2 port as an ethernet gadget and it's running AdGuard Home; the MT7621/OpenWRT/dnsmasq only handles local hostname resolution.

Admittedly one factor that makes this easy is I don't really need traffic shaping. If I ever do, I may still keep this device in an edge role to handle PPPoE/NAT, and put my x86_64 device back into service as a core router and shaper. Until then, there's a lot to be said for application-specific silicon over brute-force CPU.


I don't think we can preserve the section ids, flow_offloading and flow_offloading_hw this way, which would break compatibility with old uci configurations and break more things. I've made a small fix with a friend which hides the other option when one is selected.

@badulesia @vevere

1 Like

Getting these errors now and again running builds from latest master on a Xiaomi R4G used as a simple dumb AP hooked to main gateway over ethernet.

 9006.683212] mt7530 mdio-bus:1f: port 3 failed to delete 4e:5e:30:46:9b:fc vid 0 from fdb: -2
[ 9006.691731] mt7530 mdio-bus:1f: port 2 failed to delete 4e:5e:30:46:9b:fc vid 0 from fdb: -2
[ 9006.700202] mt7530 mdio-bus:1f: port 2 failed to delete 4e:5e:30:46:9b:fc vid 0 from fdb: -2
[ 9006.708727] mt7530 mdio-bus:1f: port 2 failed to delete 4e:5e:30:46:9b:fc vid 0 from fdb: -2
[ 9770.989287] ------------[ cut here ]------------
[ 9770.993939] WARNING: CPU: 2 PID: 1482 at target-mipsel_24kc_musl/linux-ramips_mt7621/mt76-2022-10-01-72b87836/mt7603/mac.c:208 mt7603_filter_tx+0x178/0x180 [mt7603e]
[ 9771.008743] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_ipv6 nf_flow_table_ipv4 nf_flow_table_inet pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mt76x2e mt76x2_common mt76x02_lib mt7603e mt76 mac80211 cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c crc_ccitt compat cls_flower act_vlan cls_bpf act_bpf sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_tcindex cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred act_gact sha256_generic libsha256 sha1_generic seqiv jitterentropy_rng drbg md5 hmac des_generic libdes cmac authencesn authenc leds_gpio gpio_button_hotplug crc32c_generic
[ 9771.090388] CPU: 2 PID: 1482 Comm: hostapd Not tainted 5.15.72 #0
[ 9771.096469] Stack : 00000002 800869bc 807e0000 00000004 00000000 00000000 82a99994 80a40000
[ 9771.104826]         80880000 807af2cc 824cced8 80884e83 00000000 00000001 82a99940 80c71900
[ 9771.113191]         00000000 00000000 807af2cc 82a997d8 ffffefff 00000000 ffffffea 00000000
[ 9771.121552]         82a997e4 00000139 8088aa80 ffffffff 807af2cc 00000001 00000000 827a4834
[ 9771.129909]         00000009 00000002 00003a98 80000000 00000018 80421e3c 00000008 80a40008
[ 9771.138266]         ...
[ 9771.140705] Call Trace:
[ 9771.143138] [<80008194>] show_stack+0x28/0xf0
[ 9771.147509] [<80397ae0>] dump_stack_lvl+0x60/0x80
[ 9771.152225] [<80030434>] __warn+0xc0/0x12c
[ 9771.156331] [<800304fc>] warn_slowpath_fmt+0x5c/0xac
[ 9771.161296] [<827a4834>] mt7603_filter_tx+0x178/0x180 [mt7603e]
[ 9771.167224] [<827a1aa4>] mt7603_sta_remove+0x8c/0xf4 [mt7603e]
[ 9771.173050] [<82603320>] __mt76_sta_remove+0x78/0x110 [mt76]
[ 9771.178723] [<82603490>] mt76_sta_state+0xd8/0x210 [mt76]
[ 9771.184121] [<827097d0>] sta_set_sinfo+0xf6c/0xfec [mac80211]
[ 9771.190076] 
[ 9771.191688] ---[ end trace 49aef12bc958f3b5 ]---
[36088.718660] mt76x2e 0000:01:00.0: Firmware Version: 0.0.00
[36088.724444] mt76x2e 0000:01:00.0: Build: 1
[36088.728614] mt76x2e 0000:01:00.0: Build Time: 201607111443____
[36088.757487] mt76x2e 0000:01:00.0: Firmware running!
[36088.767639] ieee80211 phy1: Hardware restart was requested```

That’s an mt76 Wi-Fi driver crash

1 Like

My change won't be accepted because it contradicts with the implementation on firewall3 and firewall4. The current way on LuCI cannot be changed because of this. Check @jow's reply on the pull request.

@badulesia @vevere

It's just a proposal to render better. How often will someone change this setting ? Just a couple of time, so it's not that bad.

I'd really like to try your build on my Xiaomi Redmi 2100 but the page linked in the topic seems to have been cleared off of those images and according to my understanding only recent snapshot images are baked in with the patch.
Is it possible to grab a non snapshot image from somewhere?
Doesn't have to be the latest official version...
I kinda know my way around customising and compiling my own images but integrating patches is beyond my current skillset... Not for the lack of tryng though...
I just couldn't find a resource that describes the process using terminology that I could wrap my head around...

1 Like

Currently, the easiest way is to get a snapshot image from the firmware selector. Anything else, you're on your own.

Not sure how the trunk/branch/release cycle happens here. If recent snapshot images have your patches, does that also mean that the just-released 22.03.1 and 21.02.4 releases also have them, or that some future official stable release will have them?

only future stable releases - 21.02 and 22.03 don't do backports of such advanced features


I'm sure this is an obvious question (not really used to technical terms), there's no way the EdgeRouter X SFP can benefit from this patch?

In the first post under devices that can't benefit it says

RGMII2 pins are used with an external phy on these:


The comment you replied to already explains this but it'd be great if you could also confirm the same behaviour I was getting on my EdgeRouter X SFP. I don't have access to the device anymore and need someone else to do a few tests on it along with this.