Follow us on...
Follow us on G+ Follow us on Twitter Follow us on Facebook Watch us on YouTube
Register
Page 3 of 3 FirstFirst 123
Results 31 to 31 of 31
  1. #31
    Status
    Offline
    zirdy's Avatar
    Baru Gabung
    Join Date
    Mar 2010
    Location
    Kediri
    Posts
    14
    Reviews
    Read 0 Reviews
    Downloads
    0
    Uploads
    0
    Feedback Score
    0
    Click here to enlarge Originally Posted by yosanpro Click here to enlarge
    Sepertinya mencocokkan MAC dengan HOST pun akan mengalami kesulitan karena HOST tidak akan diikutsertakan pada header packet TCP/IP (hanya saat memberikan lease saja), sehingga router tidak bisa memilah berdasarkan HOST. Bahkan bisa dibilang header packet TCP/IP yang berasal dari dua sumber dengan IP + MAC yang sama (static maupun DHCP) akan sangat mirip sehingga akan sangat sulit membedakannya. CMIIW...

    Solusi yang paling mungkin ya itu tadi, PPPoE... Atau kalau berada di jaringan ethernet bisa pakai Managable Switch...

    Coba ane baca-baca + coba-coba dulu, siapa tahu memang bisa...

    Tolong bantu terjemahin ini gan .....
    Sebenarnya saya juga lagi mendalami scripting mikrotik ni gan, tapi cari2 list (daftar) command nya gak dapet2. kesulitan wisss...., munkin agan punya list command-nya???
    Click here to enlarge

    1.
    :local hosts [/ip dhcp-server lease find]
    :local pcname ""
    :local pcnum 0
    :global hacklist ""
    # To log the value of $hacklist each hour, make debug 1 (if $hacklist is blank, nothing will be logged)
    :local debug 1

    :foreach h1 in=$hosts do={
    :local host [/ip dhcp-server lease get $h1 host-name]
    :if ([:len $host] >0) do {
    :set pcname ($pcname . "," . $host)
    :set pcnum ($pcnum + 1)
    }
    }

    :local pcnameArr [:toarray $pcname];

    :foreach h2 in=$pcnameArr do={
    :local hh 0
    :if (!([:find $hacklist $h2]>=0)) do={
    :foreach k in=$pcnameArr do={ :if ($k=$h2) do={:set hh ($hh + 1) } }
    :if ($hh>2) do={
    :if ([:len $hacklist] >0) do {:set hacklist ($hacklist . "," . $h2)} else={:set hacklist $h2}
    }
    }
    }

    # monitor results in logfile once an hour
    :local timer [Click here to enlargeick [/system clock get time] 3 5]
    :if (($debug > 0) || ($timer >= "58")) do={
    :if ([:len $hacklist] >0) do={
    :log warning ("New Hacklist: " . $hacklist)
    }
    }

    2.
    :local host
    :local ipnum
    :local unum
    :local usr
    :local i
    :global hacklist

    :foreach host in=$hacklist do={
    :foreach i in= [/ip dhcp-server lease find host-name=$host] do={
    :set ipnum [/ip dhcp-server lease get $i address]
    :set unum [/ip hotspot active find address=$ipnum]
    :if ([:len $unum] >0) do {
    :set usr [/ip hotspot active get $unum user]
    :log warning ($host . " " . $ipnum . " " . $usr)
    /ip hotspot active remove $unum
    }
    }
    }
    3.
    :local hosts [:toarray "comp1,comp2"]
    :local host;
    :local ipnum;
    :local unum;
    :local usr;
    :local i;

    :foreach host in=$hosts do={
    :foreach i in= [/ip dhcp-server lease find host-name=$host] do={
    :set ipnum [/ip dhcp-server lease get $i address];
    :set unum [/ip hotspot active find address=$ipnum];
    :set usr [/ip hotspot active get $unum user];
    :log warning ($host . " " . $ipnum . " " . $usr);
    /ip hotspot active remove $unum
    /ip dhcp-server lease remove [/ip dhcp-server lease find host-name=$host]
    }
    }

    4.
    script-A: (run every few minutes)
    :local hosts [/ip dhcp-server lease find]
    :local pcname "X"
    :local pcnum 0
    :global hacklist ""
    :foreach h in $hosts do={
    :local host [/ip dhcp-server lease get $h host-name]
    :if ([:len $host] >0) do {
    :set pcname ($pcname . "," . $host)
    :set pcnum ($pcnum + 1)
    }
    }
    :foreach h in $pcname do={
    :local hh 0
    :if (!([:find $hacklist $h]>=0)) do={
    :foreach k in $pcname do={ :if ($k=$h) do={:set hh ($hh + 1) } }
    :if ($hh>2) do={
    :if ([:len $hacklist] >0) do {:set hacklist ($hacklist . "," . $h)} else={:set hacklist $h}
    }
    }
    }

    # monitor results in logfile once an hour
    :local timer [Click here to enlargeick [/system clock get time] 3 5]
    :if (($switch > 0) || ($timer >= "58")) do={
    :log warning ("New Hacklist: " . $hacklist)
    }

    =======================
    script-B (runs every 20 second)
    # use global hacklist variable
    #:log info ($hacklist)
    :foreach host in $hacklist do={
    :foreach i in= [/ip dhcp-server lease find host-name $host] do={
    :local ipnum [/ip dhcp-server lease get $i address]
    :local unum [/ip hotspot active find address $ipnum]
    :if ([:len $unum] >0) do {
    :local usr [/ip hotspot active get $unum user]
    :log warning ($host . " " . $ipnum . " " . $usr)
    #next line kick them out right now, could also check pppoe
    /ip hotspot active remove $unum
    #other stuff can do now with the identified IP and USER
    }
    }
    }
    it d atas ad 4 solusi, tp lum saya cek yang sudah teruji yang mana.
    ty 4 help
    Last edited by zirdy; 23-10-2011 at 06:35.

 

 
Page 3 of 3 FirstFirst 123

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. DNS menggunakan IP Static
    By bahia in forum Beginner Basics
    Replies: 0
    Last Post: 15-01-2011, 02:07
  2. [tanya] cegah akses mikrotik dari luar
    By hamdawi in forum General Networking
    Replies: 1
    Last Post: 14-08-2010, 05:56
  3. ip horspot ke ip static
    By hebatwijaya in forum Beginner Basics
    Replies: 0
    Last Post: 20-04-2010, 12:58
  4. Regexp di Static DNS
    By thwvthunder in forum Beginner Basics
    Replies: 3
    Last Post: 28-08-2009, 16:56
  5. [ASK] WDS static
    By stevanus in forum Wireless Networking
    Replies: 4
    Last Post: 29-05-2009, 10:16

Posting Permissions

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