Open schuettecarsten opened 1 month ago
With fw4/nft, could you please try using the nft file mode option? This would significantly speed up firewall reloads.
Oh yes, that looks better.
IÄve just reopened this issue. The nft file is created at '/usr/share/nftables.d/
, but these files are not included in the list of files that should be persisted on firmware upgrade. No on the first boot after a firmware flash, the files are missing and it looks like they're not recreated automatically?
Seems to me like different issues tho.
Could you please elaborate which files are missing after first boot and/or firmware upgrade?
The missing file is /usr/share/nftables.d/ruleset-post/30-pbr.nft.
That file is re-created on pbr service:
Ok, I looked into the logs while firewall loads and expected that the file is recreated in this case also.
Ok, I looked into the logs while firewall loads and expected that the file is recreated in this case also.
Ah, you're right, It should be re-created on the firewall reload if that file doesn't exist. In that case the on_firewall_reload
command to procd script turns into start
command.
I also run into the issue that the file is NOT recreated on the boot after a firmware flash, pbr ends in invalid state and needs to be restarted manually to work properly after flash.
I also run into the issue that the file is NOT recreated on the boot after a firmware flash, pbr ends in invalid state and needs to be restarted manually to work properly after flash.
What do you mean "also"?
Please elaborate on exact steps of firmware flash.
I upload the file to /tmp/firmware.bin and run sysupgrade -v -u /tmp/firmware.bin
on an SSH console. On the next boot, PBR does not load and shows some "Invalid" errors on its Luci status page. "Reload" fixes this.
Thanks for your prompt reply. Going from which version of OpenWrt to which version of OpenWrt? What's in the log for pbr after first boot?
I just set up a rsyslog server and let you know on my next flash - tomorrow. Then I will also add some screenshots to clarify the issue and my settings.
When firewall is reloaded, pbr is executed to update routes. That's fine so far. But the script exits with exit code -9 before pbr finished to update the rules, causing the firewall reload script to end before pbr finished to update. That might cause race conditions if firewall is reloaded multiple times.
pbr restart
work without any errors, except that setting up the routing rules is somewhat slow - about 10 seconds per route, is that normal?