I have a TL-WR1043ND-v1 (8/32MB) on v22.03.3 as eth/wifi bridge (wan interface/masq disabled). It works properly most of the time but on high connection count the network sometimes dies (zero traffic) until i reconnect the wifi connection (doesn't need a reboot). Maybe the conntrack table is too large. Unless i'm wrong i think i don't need it for a simple wifi bridge. The conntrack module is loaded but can't be unloaded easily:
Any idea how to remove/unload the conntrack module?
Yes, but they can't be removed either. I also removed /etc/modules.d/nf-conntrack that holds all three modules indeed but they get loaded anyway. Regarding this post this shouldn't happen (as there is no 'blacklist' option).
If it is operating as a simple bridge then you don't need any firewalling.
What does the following show? nft list ruleset
You should try:
service firewall stop
service firewall disable
This should stop the contrack module doing anything at all.
But maybe you are just fighting lack of ram regardless. An 8/32 device really is at end of life.....
There is /rom/etc/modules.d/nf_conntrack as well laying in squashfs. Not sure how to handle this without manually compiling the image.
rmmod might not be allowed by kconfig (haven't checked though). I think it might make sense to have the module loaded on-demand only on lowmem devices on upstream in the first place.
If there is no solution for stock images i will try that.
Edit:
First quick test shows that 'cat /proc/net/nf_conntrack' remains empty after disabling the firewall service. Will need to test that on high traffic.
A hypothetical luci-minimal package might do away with https, PPPoE and maybe even opkg dependencies, but it would be very unlikely to drop firewall dependencies.
There are quite a lot of access point devices that are supported by OpenWRT. Having firewall by default on those devices doesn’t make too much sense.
I have an EAP615-Wall that I recently installed OpenWRT. My first task was to find a way to remove the firewall, dnsmasq, nftables and a few other redundant packages.
By default there isn’t even a WAN interface on that device default configuration. So the firewall seems even more pointless.
Fortunately we have the online image builder to help. Because if I had to clone the whole project and build the custom image locally I would have just kept using the original firmware.
And a couple days ago I discovered auc, which will make upgrading the system a bit more manageable.
This seems to be barking up the wrong tree. Does a layer 2 bridge even cause connection tracking?
firewall isn't even a service that is persistent in RAM. It loads rules into the kernel nftables then exits.
The services that do occupy RAM and could potentially be removed in a dumb AP include:
wpa_supplicant, and a ujail for wpa_supplicant. It is unnecessary when there are no STA wifi interfaces. hostapd and its ujail are also quite large, but obviously necessary.
dnsmasq and its ujail.
odhcpd (the IPv6 DHCP server)
uhttpd (serves LuCI-- use ssh instead)
In a default install, hostapd and wpa_supplicant are two instances of the same binary. To kill wpa_supplicant, remove the link that is /usr/sbin/wpa_supplicant. Or remove the wpad package and substitute a hostapd package.
But wouldn't these rules consume memory over time (on high conntrack count)? I've seen entries in 'cat /proc/net/nf_conntrack' indeed. Now, with the rules flushed its empty so far.
Nice trick.
RAM goes up/down between 8-10MB 'available' at the moment. First time i see 10MB though. On a fresh stock reboot its usually around 9.2MB and goes down to 7-8MB.
# free
total used free shared buff/cache available
Mem: 24948 11332 6280 60 7336 10272
I have to stresstest that in-depth. Tbh, i'm not sure if it's a memory problem at all. But it only happens on high-connection count (not high bandwidth) and the idea was that conntrack bloats so much it exceeds the ram.
Thanks for all the answers. Disabling the firewall rules seems to effectively disable conntrack usage that more or less answers the initial question.
Regarding my connection issues its probably not the router/openwrt at all but a dying STA WiFi Stick. TX-Power gets worse by the day. Error rates getting high. Traffic can be "heard" by high-pitch noise. I'll maybe try to resolder some components. Otherwise a new one will be needed.