Follow us on...
Follow us on G+ Follow us on Twitter Follow us on Facebook Watch us on YouTube
Register
Results 1 to 2 of 2
  1. #1
    Status
    Offline
    ucok_karnadi's Avatar
    ..:: Masih Bodoh ::..
    Join Date
    Jan 2009
    Location
    PATI - JAWA TENGAH
    Posts
    1,187
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0

    Trap ip berdasarkan domain

    Sebelumnya mohon maaf kepada rekan forum kalau cara yg ingin saya bagi di sini terbilang basi atau perneh ditemuin dari situs lain. karena memang script ini saya lihat dari situs lain. tapi saya lupa nama situsnya, yg pasti dari situs luar sepertinya.

    Ok kita mulai saja.

    Tidak sedikit kita memerlukan ip addres yg mungkin kita perlukan untuk blocking, priority ataupun untuk burstable. berikut saya ingin memberikan contoh script yg digunakan untuk trap ip video dan facebook berdasarkan domain dan dari dns cache. untuk trap nya menggunakan scheduler. sehingga berkala.

    Code:
    /system scheduler
    add comment="" disabled=yes interval=15m name=add-video on-event=":foreach i i\
        n=[/ip dns cache find] do={\r\
        \n    :local bNew \"true\";\r\
        \n    :local cacheName [/ip dns cache all get \$i name] ;\r\
        \n#    :put \$cacheName;\r\
        \n\r\
        \n    :if (([:find \$cacheName \"vimeo\"] != 0) || ([:find \$cacheName \"w\
        rzuta\"] != 0) || ([:find \$cacheName \"edgesuite\"] != 0) || ([:find \$ca\
        cheName \"googlevideo\"] != 0) || ([:find \$cacheName \"nba.com\"] != 0) |\
        | ([:find \$cacheName \"dailymotion\"] != 0) || ([:find \$cacheName \"xtub\
        e\"] != 0) || ([:find \$cacheName \"redtube\"] != 0) || ([:find \$cacheNam\
        e \"youtube\"] != 0) || ([:find \$cacheName \"tube8\"] != 0) || ([:find \$\
        cacheName \"pornhub\"] != 0) || ([:find \$cacheName \"youporn\"] != 0) || \
        ([:find \$cacheName \"youjizz\"] != 0) || ([:find \$cacheName \"metacafe\"\
        ] != 0) || ([:find \$cacheName \"porn99\"] != 0)) do={\r\
        \n\r\
        \n        :local tmpAddress [/ip dns cache get \$i address] ;\r\
        \n#\t:put \$tmpAddress;\r\
        \n\r\
        \n# if address list is empty do not check\r\
        \n        :if ( [/ip firewall address-list find ] = \"\") do={\r\
        \n            :log info (\"added entry: \$[/ip dns cache get \$i name] IP \
        \$tmpAddress\");\r\
        \n            /ip firewall address-list add address=\$tmpAddress list=yout\
        ube comment=\$cacheName;\r\
        \n            /ip firewall address-list add address=\$tmpAddress list=not-\
        youtube comment=\$cacheName;\r\
        \n        } else={\r\
        \n            :foreach j in=[/ip firewall address-list find ] do={\r\
        \n                :if ( [/ip firewall address-list get \$j address] = \$tm\
        pAddress ) do={\r\
        \n                    :set bNew \"false\";\r\
        \n                }\r\
        \n            }\r\
        \n            :if ( \$bNew = \"true\" ) do={\r\
        \n                :log info (\"added entry: \$[/ip dns cache get \$i name]\
        \_IP \$tmpAddress\");\r\
        \n                /ip firewall address-list add address=\$tmpAddress list=\
        youtube comment=\$cacheName;\r\
        \n                /ip firewall address-list add address=\$tmpAddress list=\
        not-youtube comment=\$cacheName;\r\
        \n            }\r\
        \n        }\r\
        \n    }\r\
        \n}\r\
        \n" policy=reboot,read,write,policy,test,password,sniff,sensitive \
        start-date=jan/01/1970 start-time=00:00:00
    add comment=facebook disabled=yes interval=15m name=add-facebook on-event=":forea\
        ch i in=[/ip dns cache find] do={\r\
        \n    :local bNew \"true\";\r\
        \n    :local cacheName [/ip dns cache all get \$i name] ;\r\
        \n#    :put \$cacheName;\r\
        \n\r\
        \n    :if (([:find \$cacheName \"facebook.com\"] != 0)) do={\r\
        \n\r\
        \n        :local tmpAddress [/ip dns cache get \$i address] ;\r\
        \n#\t:put \$tmpAddress;\r\
        \n\r\
        \n# if address list is empty do not check\r\
        \n        :if ( [/ip firewall address-list find ] = \"\") do={\r\
        \n            :log info (\"added entry: \$[/ip dns cache get \$i name] IP \
        \$tmpAddress\");\r\
        \n            /ip firewall address-list add address=\$tmpAddress list=face\
        book comment=\$cacheName;\r\
        \n        } else={\r\
        \n            :foreach j in=[/ip firewall address-list find ] do={\r\
        \n                :if ( [/ip firewall address-list get \$j address] = \$tm\
        pAddress ) do={\r\
        \n                    :set bNew \"false\";\r\
        \n                }\r\
        \n            }\r\
        \n            :if ( \$bNew = \"true\" ) do={\r\
        \n                :log info (\"added entry: \$[/ip dns cache get \$i name]\
        \_IP \$tmpAddress\");\r\
        \n                /ip firewall address-list add address=\$tmpAddress list=\
        facebook comment=\$cacheName;\r\
        \n            }\r\
        \n        }\r\
        \n    }\r\
        \n}\r\
        \n" policy=reboot,read,write,policy,test,password,sniff,sensitive \
        start-date=jan/01/1970 start-time=00:00:00


    dari address list yg terbuat bila di gabung dengan conbyte dan priority saya rasa rekan semuanya dapat membayangkannya kan?
    sedangkan selain itu ya dapat anda gunakan juga untuk yg lain. tergantung imajinasi anda.
    dan bila ada yg mengatakan bila dibandingkan dengan L7 untuk trapnya bagai mana maka silahkan di coba sendiri
    untuk facebook sebaiknya ditambahkan FBCDN juga

    kredit hanya untuk forum.
    ___________________________________________


  2. #2
    Status
    Offline
    karimasen's Avatar
    Newbie
    Join Date
    Feb 2013
    Posts
    20
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    wah,,, ane masih blm mudeng mas Click here to enlarge skip dulu ah Click here to enlarge

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Trap ip berdasarkan domain
    By ucok_karnadi in forum Tutorial
    Replies: 29
    Last Post: 07-01-2012, 11:54
  2. Website + Domain
    By dencow in forum Lapak serba-serbi
    Replies: 0
    Last Post: 27-07-2011, 21:23
  3. tanya MIB untuk trap interface di RB1100
    By cprasetya in forum General Networking
    Replies: 1
    Last Post: 20-04-2011, 21:55
  4. buat domain lokal
    By tjhoens in forum Scripting @ Mikrotik
    Replies: 10
    Last Post: 26-07-2010, 02:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •