Automatically updates IP blacklist for EdgeOS (supports IPv4 & IPv6)
Automatically updates IP blacklist for EdgeOS
Copy the script update-blacklist.sh
to /config/scripts/post-config.d/update-blacklist.sh
Make the script executable: chmod +x /config/scripts/post-config.d/update-blacklist.sh
Edit /config/config.boot
to use blacklist e.g.
firewall {
...
+ group {
+ network-group BLACKLIST_DROP {
+ }
+ network-group BLACKLIST_DROPv6 {
+ }
+ }
...
ipv6-name WANv6_IN {
...
+ rule 30 {
+ action drop
+ description "Networks to drop from blacklist"
+ source {
+ group {
+ network-group BLACKLIST_DROPv6
+ }
+ }
+ }
}
...
name WAN_IN {
...
+ rule 30 {
+ action drop
+ description "Networks to drop from blacklist"
+ source {
+ group {
+ network-group BLACKLIST_DROP
+ }
+ }
+ }
+ }
}
Edit /config/config.boot
to update blacklist e.g. everyday at 1am
system {
...
+ task-scheduler {
+ task BLACKLIST {
+ crontab-spec "0 1 * * *"
+ executable {
+ path /config/scripts/post-config.d/update-blacklist.sh
+ }
+ }
+ }
}
Reboot device: reboot