Saturday, September 25, 2010

SCript untuk menambahkan ip facebook dan akamai

SCript untuk menambahkan ip facebook dan akamai di router mikrotik. Berikut adalah SCript untuk menambahkan ip facebook dan akamai pada router mikrotik anda:


:foreach i in=[/ip dns cache find] do={
:local bNew “true”;
:local cacheName [/ip dns cache all get $i name] ;
#    :put $cacheName;
:if (([:find $cacheName “facebook”] != 0) || ([:find $cacheName “akamai”] != 0)) do={
:local tmpAddress [/ip dns cache get $i address] ;
#    :put $tmpAddress;
# if address list is empty do not check
:if ( [/ip firewall address-list find ] = “”) do={
:log info (”added entry: $[/ip dns cache get $i name] IP $tmpAddress”);
/ip firewall address-list add address=$tmpAddress list=nice comment=$cacheName;
} else={
:foreach j in=[/ip firewall address-list find ] do={
:if ( [/ip firewall address-list get $j address] = $tmpAddress ) do={
:set bNew “false”;
}
}
:if ( $bNew = “true” ) do={
:log info (”added entry: $[/ip dns cache get $i name] IP $tmpAddress”);
/ip firewall address-list add address=$tmpAddress list=nice comment=$cacheName;
}
}
}
}

semoga bermanfaat

sumber:http://anak1lang.co.cc/?p=55

1 comment:

  1. Makasih untuk sharenya...
    Saya dah coba, trus hasilnya lihat dimana ya?
    Sori nubi banget :D

    ReplyDelete

LinkWithin