Hi all,
I try for weeks to add an IP-address to a defined ipset. I defined the ipset in LUCA, then I defined the rule in the Firewall ( LUCA ).
The ipset runs with the loadfile option.
That works.
Now I try to add an new IP to the ipset-file and reload it.
It works only if I restart the entire networlk or reboot the BPI.
works not with:
uci commit firewall
service firewall restart
fw4 reload
/etc/init.d/firewall reload
/etc/init.d/firewall restart
/sbin/reload_config
fw4 reload-sets also not
But, why don't you add them directly into your OpenWrt UCI configs for the rule - and simply let the system make the proper nft stanzas for you automatically?
config ipset
option name 'bogons'
option match 'src_net'
list entry '0.0.0.0/8'
list entry '10.0.0.0/8'
list entry '100.64.0.0/10'
list entry '127.0.0.0/8'
list entry '169.254.0.0/16'
list entry '172.16.0.0/12'
list entry '192.0.0.0/24'
list entry '192.0.2.0/24'
list entry '192.168.0.0/16'
list entry '198.18.0.0/15'
list entry '198.51.100.0/24'
list entry '203.0.113.0/24'
list entry '224.0.0.0/4'
list entry '240.0.0.0/4'
config ipset
option name 'test'
option match 'src_net'
list entry 'xxx.xxx.xxx.xxx'
option loadfile '/tmp/test_ipset.txt'
(The second example shows how you can additionally use a file with a list of IP/ranges.)