~~TOC~~
/system script add name=bogons
/system script edit [/system script find name=bogons] source
## Builds an address list with bogons based on: ## http://www.team-cymru.org/Services/Bogons/bogon-bn-agg.txt :log info "Fetching bogon list." /tool fetch url="http://www.team-cymru.org/Services/Bogons/bogon-bn-agg.txt" mode=http :log info "Removing all bogons." /ip firewall address-list remove [/ip firewall address-list find list=bogons] :global content [/file get [/file find name=bogon-bn-agg.txt] contents] ; :global contentLen [:len $content]; :global lineEnd 0; :global line ""; :global lastEnd 0; :log info "Adding bogons from file." :do { :set lineEnd [:find $content "\n" $lastEnd ] ; :set line [:pick $content $lastEnd $lineEnd] ; :set lastEnd ( $lineEnd + 1 ) ; :if ( $line != "" ) do={ /ip firewall address-list add list=bogons address=$line; } } while ($lineEnd < $contentLen)
/system script run bogons
/system scheduler add interval=24h start-time=7:00:00 on-event=bogons name=update-bogons