In the docs, there is still inconsistent info about it:
Pls, update,if possible.
OR, much better, re-implement it. Using hotplug-event would be an elegant solution to re-establish custom routes from rc.local, which actually are wiped out in case of firewall restart.
## firewall
firewall3 implements hotplug events when ruleset is partially re-loaded, while firewall4 (OpenWrt 22.03 and later) does not. Similar functionality can be achieved via includes // https://openwrt.org/docs/guide-user/firewall/firewall_configuration#includes_2203_and_later_with_fw4
Hm …. I used includes for nft-rules, but how do they work to re-establish custom routes after being wiped clean because of fw4-restart ? I thought, the includes have to be nft-cmd style only.
Unfortunately, using include in /etc/config/firewall, setting up custom routing table, does not always work for me. I suspect, from time to time it might interfere with routing mods, done behind the curtain, when network restarted. Which happens several times during startup in my case.
One more neg. effect of the non-deterministic startup procedure.
However, now my walk-around is to use /etc/hotplug.d/iface/myroutingscript.sh .
My very first approach was simply to include the following 3 lines at end of rc.local:
sleep 60 #Something smarter, in fact
sh /etc/myroutingscript.sh
hev-socks5-tproxy /etc/hev-socks5-tproxy/main.yml
Worked. Until next restart of network, because my routing mods dropped.
myroutingscript.sh only contains 2 lines:
ip rule add fwmark 1088 table 100
ip route add local default dev lo table 100
I had a very first look at PBR. But seems rather complicated for this simple requirement. BTW, it might be good idea, on network restart to leave custom mods (i.e. in routing) still intact.
Yep. For 5 years already living in Lazur. 10minutes walk to my favourite beach bar, Caribe. Only during wintertime relocating to Asia. You are welcome for a beer