amarcu5 / EdgeOS-Blacklist

Automatically updates IP blacklist for EdgeOS (supports IPv4 & IPv6)
GNU General Public License v3.0
41 stars 10 forks source link

Issue when running the script "The sets cannot be swapped..." #5

Open Barichon21 opened 5 years ago

Barichon21 commented 5 years ago

ubnt: Blacklist update failed ('The sets cannot be swapped: their type does not match' whilst executing 'sudo ipset swap BLACKLIST_DROPv6-21813 BLACKLIST_DROPv6')

Any idea ?

ParaVirtual commented 5 years ago

This just had me for a while as well. The issue exists because the very first blank incarnation of the set "BLACKLIST_DROPv6" is set as "family inet" as opposed to the correct "family inet6".

So ipset is being asked to swap an inet6 (IPv6) )list in the place of a inet (IPv4) list - and their type does not match.

To fix this we can manually we can use the following after running script and it failing: sudo ipset destroy BLACKLIST_DROPv6 sudo ipset rename BLACKLIST_DROPv6-8323 BLACKLIST_DROPv6 (replacing -numbersequence as appropriate to your environment, they always change)

and then run

/config/scripts/post-config.d/update-blacklist.sh

again, and it will complete successfully.

I'm not sure of the best way to fix this from the get go, but it probably involves changing the instructions on editing config.boot and declaring network-group BLACKLIST_DROPv6 {} I imagine there's some way to set it as IPv6 from the get go, just not sure how.

rlem83 commented 4 years ago

Although this is not maintained since it was created, I did identify the issue. In the readme it incorrectly tells you to create the wrong type of ipv6 Blocklist: original: network-group BLACKLIST_DROPv6

corrected: ipv6-network-group BLACKLIST_DROPv6

This will fix your swapping issues.

gunnahafta commented 2 years ago

I also had the problem. Turned out if your not getting an IPv6 IP from your ISP then you cant create an IPv6 network address group.

Commented out the line "#swap $NEWGROUPv6 $NETGROUPv6" and it worked.