Hardware NAT For LEDE

Great news, thanks for hard work @nbd

@nbd I built an image from your staging branch to my Xiaomi MIR3G and offloading seems to work great, thank you!
I noticed one thing which is a bit bugging me. Offloaded connections don't seem to register in ifconfig's RX/TX bytes on the WAN and LAN interfaces, so Luci's traffic graphs, vnstat and collectd can't measure the amount of traffic.
Is this an expected side-effect of offloading? Can this be fixed somehow?

Has flowoffload hit the snapshot build for Archer C7 v2? Also do you just run the command

iptables -I FORWARD 1 -m conntrack --ctstate RELATED,ESTABLISHED -j FLOWOFFLOAD

in SSH and that's it?

ar71xx is still on kernel 4.9, while you require kernel >= 4.14 (4.16 in mainline) for flowoffload support. (ar71xx will probably remain on kernel 4.9, until ath79 takes over).


Hi @nbd

On Octeon soc, does flow offload can accel to normal routing (LAN-LAN routing, not NAT routing) ? or just accel to NAT routing ?

Flow offload handles normal routing as well.
By the way, there is no need to manually mess with iptables rules anymore.
Just set option flow_offloading 1 in defaults in /etc/config/firewall
On MT7621 you can additionally set option flow_offloading_hw 1 to enable hardware offloading. This will not work with SQM though.


Once more question.
If i'm enable flow offload & sqm same time, what things is affected ? ex: sqm performance will decrease, flow-offload perf decrease ? ..etc..

1 Like

As far as I know, sqm doesn't work AT ALL with flow offload. The packets don't go through the linux qdiscs etc it just sidesteps everything. Someone please correct me if I'm wrong.

Software offload does not bypass linux qdisc. It only bypasses the CPU intensive iptables rule processing.

Also with QoS scripts?
Many thanks

SQM and QoS does work with flow offloading but not with hw flow offloading!

hw flow offloading is currently only supported for mt7621.

1 Like

A bit late but i just wanted to tell you that its working now in the latest version.

Shaping with hw offloading?

latest version of what?

My message was a reply to nbds comment above asking me for a packet dump.
Its not related to SQM at all. (Im blaming discourse for the bad visibility of that fact)

On a sidenote sqm and hw offloading together will not work as long as the sqm stuff is not done by the offloading hardware itself (so probably never.)

And im using the latest version that is available on the master branch of openwrt aka lede.

Just making sure: is there any kmod package I should be selecting, or is flowoffload baked inside the base code? (or another package I'm not aware of)
I'm trying to replace NSS stack with this as a best option given that I'm not a programmer and can't port the R7800 version of the NSS stack to my device.

All tagets with >= 4.14 Kernel have offloading included.
You only have to set option flow_offloading 1 in firewall default config section.

1 Like

I'm trying to compile this feature in the the openwrt-18 snapshot. Does it need both of these kernel modules enabled?


The ipt module is for iptables, the nft module is for nftables. Use the module for whatever firewall you are using. Lede uses iptables by default.

Is there a way to confirm offloading is running?