Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


routeros_bogon_update

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
routeros_bogon_update [2015/04/19 12:02] – [RouterOS 6.x - Update bogon list automatically] adminrouteros_bogon_update [2021/10/09 15:14] – external edit 127.0.0.1
Line 1: Line 1:
 {{tag>[security routeros mikrotik bogon bogons]}} {{tag>[security routeros mikrotik bogon bogons]}}
-~~TOC~~ 
  
 =====RouterOS 6.x - Update bogon list automatically===== =====RouterOS 6.x - Update bogon list automatically=====
Line 27: Line 26:
        :set lastEnd ( $lineEnd + 1 ) ;        :set lastEnd ( $lineEnd + 1 ) ;
  
-       :local tmpArray [:toarray $line] ; +       :if ( $line != "" ) do={ 
- :if ( [:pick $tmpArray 0] != "" ) do={ +         /ip firewall address-list add list=bogons address=$line
- :put $tmpArray; +       }
-         /ip firewall address-list add name=bogons address=[:pick $tmpArray 0]+
-}+
 } while ($lineEnd < $contentLen)</code> } while ($lineEnd < $contentLen)</code>
   * Test run script:<code>/system script run bogons</code>   * Test run script:<code>/system script run bogons</code>
   * Schedule script:<code>/system scheduler add interval=24h start-time=7:00:00 on-event=bogons name=update-bogons</code>   * Schedule script:<code>/system scheduler add interval=24h start-time=7:00:00 on-event=bogons name=update-bogons</code>
  
routeros_bogon_update.txt · Last modified: 2021/10/31 14:40 by admin